Files
gps/tools/local/circt/include/mlir/Dialect/LLVMIR/LLVMIntrinsicOps.cpp.inc
T
2026-07-12 11:01:51 +03:00

71341 lines
3.4 MiB
Plaintext

/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
|* *|
|* Op Definitions *|
|* *|
|* Automatically generated file, do not edit! *|
|* From: LLVMIntrinsicOps.td *|
|* *|
\*===----------------------------------------------------------------------===*/
#ifdef GET_OP_LIST
#undef GET_OP_LIST
::mlir::LLVM::ACosOp,
::mlir::LLVM::ASinOp,
::mlir::LLVM::ATan2Op,
::mlir::LLVM::ATanOp,
::mlir::LLVM::AbsOp,
::mlir::LLVM::Annotation,
::mlir::LLVM::AssumeOp,
::mlir::LLVM::BitReverseOp,
::mlir::LLVM::ByteSwapOp,
::mlir::LLVM::ConstrainedFAddIntr,
::mlir::LLVM::ConstrainedFDivIntr,
::mlir::LLVM::ConstrainedFMAIntr,
::mlir::LLVM::ConstrainedFMulAddIntr,
::mlir::LLVM::ConstrainedFMulIntr,
::mlir::LLVM::ConstrainedFPExtIntr,
::mlir::LLVM::ConstrainedFPTruncIntr,
::mlir::LLVM::ConstrainedFRemIntr,
::mlir::LLVM::ConstrainedFSubIntr,
::mlir::LLVM::ConstrainedSIToFP,
::mlir::LLVM::ConstrainedUIToFP,
::mlir::LLVM::CopySignOp,
::mlir::LLVM::CoroAlignOp,
::mlir::LLVM::CoroBeginOp,
::mlir::LLVM::CoroEndOp,
::mlir::LLVM::CoroFreeOp,
::mlir::LLVM::CoroIdOp,
::mlir::LLVM::CoroPromiseOp,
::mlir::LLVM::CoroResumeOp,
::mlir::LLVM::CoroSaveOp,
::mlir::LLVM::CoroSizeOp,
::mlir::LLVM::CoroSuspendOp,
::mlir::LLVM::CosOp,
::mlir::LLVM::CoshOp,
::mlir::LLVM::CountLeadingZerosOp,
::mlir::LLVM::CountTrailingZerosOp,
::mlir::LLVM::CtPopOp,
::mlir::LLVM::DbgDeclareOp,
::mlir::LLVM::DbgLabelOp,
::mlir::LLVM::DbgValueOp,
::mlir::LLVM::DebugTrap,
::mlir::LLVM::EhTypeidForOp,
::mlir::LLVM::Exp10Op,
::mlir::LLVM::Exp2Op,
::mlir::LLVM::ExpOp,
::mlir::LLVM::ExpectOp,
::mlir::LLVM::ExpectWithProbabilityOp,
::mlir::LLVM::FAbsOp,
::mlir::LLVM::FCeilOp,
::mlir::LLVM::FFloorOp,
::mlir::LLVM::FMAOp,
::mlir::LLVM::FMulAddOp,
::mlir::LLVM::FTruncOp,
::mlir::LLVM::FakeUseOp,
::mlir::LLVM::FractionExpOp,
::mlir::LLVM::FshlOp,
::mlir::LLVM::FshrOp,
::mlir::LLVM::GetActiveLaneMaskOp,
::mlir::LLVM::InvariantEndOp,
::mlir::LLVM::InvariantStartOp,
::mlir::LLVM::IsConstantOp,
::mlir::LLVM::IsFPClass,
::mlir::LLVM::LaunderInvariantGroupOp,
::mlir::LLVM::LifetimeEndOp,
::mlir::LLVM::LifetimeStartOp,
::mlir::LLVM::LlrintOp,
::mlir::LLVM::LlroundOp,
::mlir::LLVM::LoadExpOp,
::mlir::LLVM::Log10Op,
::mlir::LLVM::Log2Op,
::mlir::LLVM::LogOp,
::mlir::LLVM::LrintOp,
::mlir::LLVM::LroundOp,
::mlir::LLVM::MaskedLoadOp,
::mlir::LLVM::MaskedStoreOp,
::mlir::LLVM::MatrixColumnMajorLoadOp,
::mlir::LLVM::MatrixColumnMajorStoreOp,
::mlir::LLVM::MatrixMultiplyOp,
::mlir::LLVM::MatrixTransposeOp,
::mlir::LLVM::MaxNumOp,
::mlir::LLVM::MaximumOp,
::mlir::LLVM::MemcpyInlineOp,
::mlir::LLVM::MemcpyOp,
::mlir::LLVM::MemmoveOp,
::mlir::LLVM::MemsetInlineOp,
::mlir::LLVM::MemsetOp,
::mlir::LLVM::MinNumOp,
::mlir::LLVM::MinimumOp,
::mlir::LLVM::NearbyintOp,
::mlir::LLVM::NoAliasScopeDeclOp,
::mlir::LLVM::PowIOp,
::mlir::LLVM::PowOp,
::mlir::LLVM::Prefetch,
::mlir::LLVM::PtrAnnotation,
::mlir::LLVM::PtrMaskOp,
::mlir::LLVM::RintOp,
::mlir::LLVM::RoundEvenOp,
::mlir::LLVM::RoundOp,
::mlir::LLVM::SAddSat,
::mlir::LLVM::SAddWithOverflowOp,
::mlir::LLVM::SCmpOp,
::mlir::LLVM::SMaxOp,
::mlir::LLVM::SMinOp,
::mlir::LLVM::SMulWithOverflowOp,
::mlir::LLVM::SSACopyOp,
::mlir::LLVM::SSHLSat,
::mlir::LLVM::SSubSat,
::mlir::LLVM::SSubWithOverflowOp,
::mlir::LLVM::SinOp,
::mlir::LLVM::SincosOp,
::mlir::LLVM::SinhOp,
::mlir::LLVM::SqrtOp,
::mlir::LLVM::StackRestoreOp,
::mlir::LLVM::StackSaveOp,
::mlir::LLVM::StepVectorOp,
::mlir::LLVM::StripInvariantGroupOp,
::mlir::LLVM::TanOp,
::mlir::LLVM::TanhOp,
::mlir::LLVM::ThreadlocalAddressOp,
::mlir::LLVM::Trap,
::mlir::LLVM::UAddSat,
::mlir::LLVM::UAddWithOverflowOp,
::mlir::LLVM::UBSanTrap,
::mlir::LLVM::UCmpOp,
::mlir::LLVM::UMaxOp,
::mlir::LLVM::UMinOp,
::mlir::LLVM::UMulWithOverflowOp,
::mlir::LLVM::USHLSat,
::mlir::LLVM::USubSat,
::mlir::LLVM::USubWithOverflowOp,
::mlir::LLVM::VPAShrOp,
::mlir::LLVM::VPAddOp,
::mlir::LLVM::VPAndOp,
::mlir::LLVM::VPFAddOp,
::mlir::LLVM::VPFDivOp,
::mlir::LLVM::VPFMulAddOp,
::mlir::LLVM::VPFMulOp,
::mlir::LLVM::VPFNegOp,
::mlir::LLVM::VPFPExtOp,
::mlir::LLVM::VPFPToSIOp,
::mlir::LLVM::VPFPToUIOp,
::mlir::LLVM::VPFPTruncOp,
::mlir::LLVM::VPFRemOp,
::mlir::LLVM::VPFSubOp,
::mlir::LLVM::VPFmaOp,
::mlir::LLVM::VPIntToPtrOp,
::mlir::LLVM::VPLShrOp,
::mlir::LLVM::VPLoadOp,
::mlir::LLVM::VPMergeMinOp,
::mlir::LLVM::VPMulOp,
::mlir::LLVM::VPOrOp,
::mlir::LLVM::VPPtrToIntOp,
::mlir::LLVM::VPReduceAddOp,
::mlir::LLVM::VPReduceAndOp,
::mlir::LLVM::VPReduceFAddOp,
::mlir::LLVM::VPReduceFMaxOp,
::mlir::LLVM::VPReduceFMinOp,
::mlir::LLVM::VPReduceFMulOp,
::mlir::LLVM::VPReduceMulOp,
::mlir::LLVM::VPReduceOrOp,
::mlir::LLVM::VPReduceSMaxOp,
::mlir::LLVM::VPReduceSMinOp,
::mlir::LLVM::VPReduceUMaxOp,
::mlir::LLVM::VPReduceUMinOp,
::mlir::LLVM::VPReduceXorOp,
::mlir::LLVM::VPSDivOp,
::mlir::LLVM::VPSExtOp,
::mlir::LLVM::VPSIToFPOp,
::mlir::LLVM::VPSMaxOp,
::mlir::LLVM::VPSMinOp,
::mlir::LLVM::VPSRemOp,
::mlir::LLVM::VPSelectMinOp,
::mlir::LLVM::VPShlOp,
::mlir::LLVM::VPStoreOp,
::mlir::LLVM::VPStridedLoadOp,
::mlir::LLVM::VPStridedStoreOp,
::mlir::LLVM::VPSubOp,
::mlir::LLVM::VPTruncOp,
::mlir::LLVM::VPUDivOp,
::mlir::LLVM::VPUIToFPOp,
::mlir::LLVM::VPUMaxOp,
::mlir::LLVM::VPUMinOp,
::mlir::LLVM::VPURemOp,
::mlir::LLVM::VPXorOp,
::mlir::LLVM::VPZExtOp,
::mlir::LLVM::VaCopyOp,
::mlir::LLVM::VaEndOp,
::mlir::LLVM::VaStartOp,
::mlir::LLVM::VarAnnotation,
::mlir::LLVM::masked_compressstore,
::mlir::LLVM::masked_expandload,
::mlir::LLVM::masked_gather,
::mlir::LLVM::masked_scatter,
::mlir::LLVM::vector_deinterleave2,
::mlir::LLVM::vector_extract,
::mlir::LLVM::vector_insert,
::mlir::LLVM::vector_interleave2,
::mlir::LLVM::vector_reduce_add,
::mlir::LLVM::vector_reduce_and,
::mlir::LLVM::vector_reduce_fadd,
::mlir::LLVM::vector_reduce_fmax,
::mlir::LLVM::vector_reduce_fmaximum,
::mlir::LLVM::vector_reduce_fmin,
::mlir::LLVM::vector_reduce_fminimum,
::mlir::LLVM::vector_reduce_fmul,
::mlir::LLVM::vector_reduce_mul,
::mlir::LLVM::vector_reduce_or,
::mlir::LLVM::vector_reduce_smax,
::mlir::LLVM::vector_reduce_smin,
::mlir::LLVM::vector_reduce_umax,
::mlir::LLVM::vector_reduce_umin,
::mlir::LLVM::vector_reduce_xor,
::mlir::LLVM::vscale
#endif // GET_OP_LIST
#ifdef GET_OP_CLASSES
#undef GET_OP_CLASSES
//===----------------------------------------------------------------------===//
// Local Utility Method Definitions
//===----------------------------------------------------------------------===//
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps1(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::mlir::LLVM::isCompatibleFloatingPointType(type))) || (((::mlir::LLVM::isCompatibleVectorType(type))) && ((::mlir::LLVM::isCompatibleFloatingPointType(::llvm::cast<::mlir::VectorType>(type).getElementType())))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be floating point LLVM type or LLVM dialect-compatible vector of floating point LLVM type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps2(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::mlir::LLVM::isCompatibleOuterType(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM dialect-compatible type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps3(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((type.isSignlessInteger())) || (((::mlir::LLVM::isCompatibleVectorType(type))) && ((::llvm::cast<::mlir::VectorType>(type).getElementType().isSignlessInteger()))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be signless integer or LLVM dialect-compatible vector of signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps4(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((type.isSignlessInteger()))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps5(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::llvm::isa<::mlir::LLVM::LLVMPointerType>(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM pointer type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps6(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((type.isSignlessInteger(32)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be 32-bit signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps7(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((type.isSignlessInteger(1)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be 1-bit signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps8(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::mlir::LLVM::isCompatibleOuterType(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be variadic of LLVM dialect-compatible type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps9(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::llvm::isa<::mlir::TokenType>(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be token, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps10(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::llvm::isa<::mlir::LLVM::LLVMPointerType>(type))) && ((::llvm::cast<::mlir::LLVM::LLVMPointerType>(type).getAddressSpace() == 0)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM pointer in address space 0, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps11(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::mlir::LLVM::isCompatibleFloatingPointType(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be floating point LLVM type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps12(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::mlir::LLVM::isCompatibleVectorType(type))) && ((::llvm::cast<::mlir::VectorType>(type).getElementType().isSignlessInteger(1))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM dialect-compatible vector of 1-bit signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps13(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::mlir::LLVM::isCompatibleVectorType(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM dialect-compatible vector type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps14(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((type.isSignlessInteger(8)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be 8-bit signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps15(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::llvm::isa<::mlir::LLVM::LLVMPointerType>(type))) || (((::mlir::LLVM::isCompatibleVectorType(type))) && ((::llvm::isa<::mlir::LLVM::LLVMPointerType>(::llvm::cast<::mlir::VectorType>(type).getElementType())))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM pointer type or LLVM dialect-compatible vector of LLVM pointer type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps16(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::llvm::isa<::mlir::IntegerType>(type))) || (((::mlir::LLVM::isCompatibleVectorType(type))) && ((::llvm::isa<::mlir::IntegerType>(::llvm::cast<::mlir::VectorType>(type).getElementType())))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be integer or LLVM dialect-compatible vector of integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps17(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(!((::llvm::isa<::mlir::TokenType>(type))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be any non-token type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps18(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::mlir::LLVM::isCompatibleVectorType(type))) && ((::llvm::cast<::mlir::VectorType>(type).getElementType().isSignlessInteger())))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM dialect-compatible vector of signless integer, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps19(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::mlir::LLVM::isCompatibleVectorType(type))) && ((::llvm::isa<::mlir::FloatType>(::llvm::cast<::mlir::VectorType>(type).getElementType()))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM dialect-compatible vector of floating-point, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps20(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!(((::mlir::LLVM::isCompatibleVectorType(type))) && ((::llvm::isa<::mlir::LLVM::LLVMPointerType>(::llvm::cast<::mlir::VectorType>(type).getElementType()))))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be LLVM dialect-compatible vector of LLVM pointer type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps21(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::llvm::isa<::mlir::FloatType>(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be floating-point, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_type_constraint_LLVMIntrinsicOps22(
::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
unsigned valueIndex) {
if (!((::mlir::LLVM::isCompatibleVectorType(type)))) {
return op->emitOpError(valueKind) << " #" << valueIndex
<< " must be variadic of LLVM dialect-compatible vector type, but got " << type;
}
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: LLVM fastmath flags";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::cast<::mlir::IntegerAttr>(attr).getType().isSignlessInteger(1)))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: 1-bit signless integer attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps3(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: i32 dense array attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps3(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps3(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps4(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::ArrayAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: array attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps4(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps4(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(attr))) && ((::llvm::cast<::mlir::IntegerAttr>(attr).getInt() >= 0))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: LLVM Exception Behavior";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps7(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::LLVM::DILocalVariableAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: ";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps7(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps7(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps8(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::LLVM::DIExpressionAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: ";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps8(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps8(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps9(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::LLVM::DILabelAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: ";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps9(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps9(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps10(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::FloatAttr>(attr))) && ((::llvm::cast<::mlir::FloatAttr>(attr).getType().isF64()))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: 64-bit float attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps10(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps10(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::cast<::mlir::IntegerAttr>(attr).getType().isSignlessInteger(64)))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: 64-bit signless integer attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::cast<::mlir::IntegerAttr>(attr).getType().isSignlessInteger(32)))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: 32-bit signless integer attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps13(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::UnitAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: unit attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps13(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps13(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps14(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::IntegerAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: arbitrary integer attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps14(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps14(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AccessGroupAttr>(attr))); }))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: LLVM dialect access group metadata array";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: LLVM dialect alias scope array";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::TBAATagAttr>(attr))); }))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: LLVM dialect TBAA tag metadata array";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: Array of dictionary attributes";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps19(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: LLVM dialect alias scope";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps19(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps19(attr, attrName, [op]() {
return op->emitOpError();
});
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps20(
::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
if (attr && !(((::llvm::isa<::mlir::IntegerAttr>(attr))) && ((::llvm::cast<::mlir::IntegerAttr>(attr).getType().isSignlessInteger(8)))))
return emitError() << "attribute '" << attrName
<< "' failed to satisfy constraint: 8-bit signless integer attribute";
return ::mlir::success();
}
static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_LLVMIntrinsicOps20(
::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
return __mlir_ods_local_attr_constraint_LLVMIntrinsicOps20(attr, attrName, [op]() {
return op->emitOpError();
});
}
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ACosOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ACosOpGenericAdaptorBase::ACosOpGenericAdaptorBase(ACosOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr ACosOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags ACosOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
ACosOpAdaptor::ACosOpAdaptor(ACosOp op) : ACosOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ACosOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.acos' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult ACosOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ACosOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ACosOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ACosOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void ACosOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void ACosOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult ACosOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ACosOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void ACosOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags ACosOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void ACosOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ACosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ACosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ACosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ACosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ACosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ACosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ACosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ACosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ACosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ACosOp ACosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ACosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ACosOp ACosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ACosOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult ACosOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ACosOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ACosOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ACosOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ACosOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void ACosOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ACosOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ACosOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ASinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ASinOpGenericAdaptorBase::ASinOpGenericAdaptorBase(ASinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr ASinOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags ASinOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
ASinOpAdaptor::ASinOpAdaptor(ASinOp op) : ASinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ASinOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.asin' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult ASinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ASinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ASinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ASinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void ASinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void ASinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult ASinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ASinOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void ASinOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags ASinOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void ASinOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ASinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ASinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ASinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ASinOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ASinOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ASinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ASinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ASinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ASinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ASinOp ASinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ASinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ASinOp ASinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ASinOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult ASinOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ASinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ASinOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ASinOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ASinOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void ASinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ASinOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ASinOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ATan2Op definitions
//===----------------------------------------------------------------------===//
namespace detail {
ATan2OpGenericAdaptorBase::ATan2OpGenericAdaptorBase(ATan2Op op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr ATan2OpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags ATan2OpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
ATan2OpAdaptor::ATan2OpAdaptor(ATan2Op op) : ATan2OpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ATan2OpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.atan2' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult ATan2Op::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ATan2Op::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ATan2Op::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ATan2Op::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void ATan2Op::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void ATan2Op::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult ATan2Op::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ATan2Op::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void ATan2Op::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags ATan2Op::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void ATan2Op::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATan2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATan2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATan2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ATan2Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ATan2Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATan2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ATan2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ATan2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATan2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ATan2Op ATan2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ATan2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATan2Op ATan2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ATan2Op::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult ATan2Op::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ATan2Op::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ATan2Op::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ATan2Op::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ATan2Op::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void ATan2Op::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ATan2Op)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ATan2OpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ATanOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ATanOpGenericAdaptorBase::ATanOpGenericAdaptorBase(ATanOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr ATanOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags ATanOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
ATanOpAdaptor::ATanOpAdaptor(ATanOp op) : ATanOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ATanOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.atan' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult ATanOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ATanOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ATanOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ATanOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void ATanOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void ATanOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult ATanOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ATanOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void ATanOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags ATanOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void ATanOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ATanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ATanOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ATanOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ATanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ATanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ATanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ATanOp ATanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ATanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ATanOp ATanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ATanOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult ATanOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ATanOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ATanOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ATanOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ATanOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void ATanOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ATanOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ATanOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::AbsOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
AbsOpGenericAdaptorBase::AbsOpGenericAdaptorBase(AbsOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool AbsOpGenericAdaptorBase::getIsIntMinPoison() {
auto attr = getIsIntMinPoisonAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
AbsOpAdaptor::AbsOpAdaptor(AbsOp op) : AbsOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult AbsOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_is_int_min_poison = getProperties().is_int_min_poison; (void)tblgen_is_int_min_poison;
if (!tblgen_is_int_min_poison) return emitError(loc, "'llvm.intr.abs' op requires attribute 'is_int_min_poison'");
if (tblgen_is_int_min_poison && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_is_int_min_poison))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_is_int_min_poison).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.abs' op attribute 'is_int_min_poison' failed to satisfy constraint: 1-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult AbsOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.is_int_min_poison;
auto attr = dict.get("is_int_min_poison");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `is_int_min_poison` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute AbsOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.is_int_min_poison;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("is_int_min_poison",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code AbsOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.is_int_min_poison.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> AbsOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "is_int_min_poison")
return prop.is_int_min_poison;
return std::nullopt;
}
void AbsOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "is_int_min_poison") {
prop.is_int_min_poison = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.is_int_min_poison)>>(value);
return;
}
}
void AbsOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.is_int_min_poison) attrs.append("is_int_min_poison", prop.is_int_min_poison);
}
::llvm::LogicalResult AbsOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getIsIntMinPoisonAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "is_int_min_poison", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult AbsOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.is_int_min_poison)))
return ::mlir::failure();
return ::mlir::success();
}
void AbsOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.is_int_min_poison);
}
bool AbsOp::getIsIntMinPoison() {
auto attr = getIsIntMinPoisonAttr();
return attr.getValue().getZExtValue();
}
void AbsOp::setIsIntMinPoison(bool attrValue) {
getProperties().is_int_min_poison = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_int_min_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_int_min_poison = is_int_min_poison;
odsState.addTypes(res);
}
AbsOp AbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_int_min_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
auto __res__ = ::llvm::dyn_cast<AbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AbsOp AbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_int_min_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
}
void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_int_min_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_int_min_poison = is_int_min_poison;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
AbsOp AbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_int_min_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
auto __res__ = ::llvm::dyn_cast<AbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AbsOp AbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_int_min_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
}
void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, bool is_int_min_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_int_min_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_int_min_poison);
odsState.addTypes(res);
}
AbsOp AbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, bool is_int_min_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
auto __res__ = ::llvm::dyn_cast<AbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AbsOp AbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, bool is_int_min_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
}
void AbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_int_min_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_int_min_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_int_min_poison);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
AbsOp AbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_int_min_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
auto __res__ = ::llvm::dyn_cast<AbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AbsOp AbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_int_min_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_int_min_poison)>(is_int_min_poison));
}
void AbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<AbsOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
AbsOp AbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<AbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AbsOp AbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void AbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
AbsOp AbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<AbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AbsOp AbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult AbsOp::verifyInvariantsImpl() {
auto tblgen_is_int_min_poison = getProperties().is_int_min_poison; (void)tblgen_is_int_min_poison;
if (!tblgen_is_int_min_poison) return emitOpError("requires attribute 'is_int_min_poison'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_is_int_min_poison, "is_int_min_poison")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult AbsOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult AbsOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.is_int_min_poison;
auto is_int_min_poisonAttrName = ::mlir::StringAttr::get(ctx, "is_int_min_poison");
auto attr = dict.get(is_int_min_poisonAttrName);
usedKeys.insert(is_int_min_poisonAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for is_int_min_poison in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `is_int_min_poison` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void AbsOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::AbsOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::AbsOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::Annotation definitions
//===----------------------------------------------------------------------===//
namespace detail {
AnnotationGenericAdaptorBase::AnnotationGenericAdaptorBase(Annotation op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
AnnotationAdaptor::AnnotationAdaptor(Annotation op) : AnnotationGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult AnnotationAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult Annotation::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute Annotation::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code Annotation::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> Annotation::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void Annotation::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void Annotation::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult Annotation::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void Annotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
odsState.addOperands(integer);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
odsState.addTypes(res);
}
Annotation Annotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(integer)>(integer), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line));
auto __res__ = ::llvm::dyn_cast<Annotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Annotation Annotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(integer)>(integer), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line));
}
void Annotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
odsState.addOperands(integer);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Annotation::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Annotation Annotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(integer)>(integer), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line));
auto __res__ = ::llvm::dyn_cast<Annotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Annotation Annotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
return create(builder, builder.getLoc(), std::forward<decltype(integer)>(integer), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line));
}
void Annotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
odsState.addOperands(integer);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Annotation Annotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(integer)>(integer), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line));
auto __res__ = ::llvm::dyn_cast<Annotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Annotation Annotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value integer, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(integer)>(integer), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line));
}
void Annotation::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Annotation Annotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Annotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Annotation Annotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Annotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Annotation::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Annotation Annotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Annotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Annotation Annotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Annotation::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Annotation Annotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Annotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Annotation Annotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Annotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Annotation::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Annotation Annotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Annotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Annotation Annotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult Annotation::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType()) && ((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()))))
return emitOpError("failed to verify that all of {res, integer} have same type");
if (!((((*this->getODSOperands(1).begin()).getType()) == ((*this->getODSOperands(2).begin()).getType()) && ((*this->getODSOperands(2).begin()).getType()) == ((*this->getODSOperands(1).begin()).getType()))))
return emitOpError("failed to verify that all of {annotation, fileName} have same type");
return ::mlir::success();
}
::llvm::LogicalResult Annotation::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult Annotation::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::llvm::LogicalResult Annotation::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::Annotation)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::AssumeOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
AssumeOpGenericAdaptorBase::AssumeOpGenericAdaptorBase(AssumeOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> AssumeOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
bool isVariadic[] = {false, true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (odsOperandsSize - 1) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
::llvm::ArrayRef<int32_t> AssumeOpGenericAdaptorBase::getOpBundleSizes() {
auto attr = getOpBundleSizesAttr();
return attr;
}
::std::optional< ::mlir::ArrayAttr > AssumeOpGenericAdaptorBase::getOpBundleTags() {
auto attr = getOpBundleTagsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
AssumeOpAdaptor::AssumeOpAdaptor(AssumeOp op) : AssumeOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult AssumeOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_op_bundle_sizes = getProperties().op_bundle_sizes; (void)tblgen_op_bundle_sizes;
if (!tblgen_op_bundle_sizes) return emitError(loc, "'llvm.intr.assume' op requires attribute 'op_bundle_sizes'");
auto tblgen_op_bundle_tags = getProperties().op_bundle_tags; (void)tblgen_op_bundle_tags;
if (tblgen_op_bundle_sizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_op_bundle_sizes))))
return emitError(loc, "'llvm.intr.assume' op attribute 'op_bundle_sizes' failed to satisfy constraint: i32 dense array attribute");
if (tblgen_op_bundle_tags && !((::llvm::isa<::mlir::ArrayAttr>(tblgen_op_bundle_tags))))
return emitError(loc, "'llvm.intr.assume' op attribute 'op_bundle_tags' failed to satisfy constraint: array attribute");
return ::mlir::success();
}
std::pair<unsigned, unsigned> AssumeOp::getODSOperandIndexAndLength(unsigned index) {
bool isVariadic[] = {false, true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
::mlir::MutableOperandRangeRange AssumeOp::getOpBundleOperandsMutable() {
auto range = getODSOperandIndexAndLength(1);
auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
return mutableRange.split(*(*this)->getAttrDictionary().getNamed(getOpBundleSizesAttrName()));
}
::llvm::LogicalResult AssumeOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.op_bundle_sizes;
auto attr = dict.get("op_bundle_sizes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `op_bundle_sizes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.op_bundle_tags;
auto attr = dict.get("op_bundle_tags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `op_bundle_tags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute AssumeOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.op_bundle_sizes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("op_bundle_sizes",
propStorage));
}
{
const auto &propStorage = prop.op_bundle_tags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("op_bundle_tags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code AssumeOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.op_bundle_sizes.getAsOpaquePointer()),
llvm::hash_value(prop.op_bundle_tags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> AssumeOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "op_bundle_sizes")
return prop.op_bundle_sizes;
if (name == "op_bundle_tags")
return prop.op_bundle_tags;
return std::nullopt;
}
void AssumeOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "op_bundle_sizes") {
prop.op_bundle_sizes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.op_bundle_sizes)>>(value);
return;
}
if (name == "op_bundle_tags") {
prop.op_bundle_tags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.op_bundle_tags)>>(value);
return;
}
}
void AssumeOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.op_bundle_sizes) attrs.append("op_bundle_sizes", prop.op_bundle_sizes);
if (prop.op_bundle_tags) attrs.append("op_bundle_tags", prop.op_bundle_tags);
}
::llvm::LogicalResult AssumeOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getOpBundleSizesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps3(attr, "op_bundle_sizes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getOpBundleTagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps4(attr, "op_bundle_tags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult AssumeOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.op_bundle_sizes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.op_bundle_tags)))
return ::mlir::failure();
return ::mlir::success();
}
void AssumeOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.op_bundle_sizes);
writer.writeOptionalAttribute(prop.op_bundle_tags);
}
::llvm::ArrayRef<int32_t> AssumeOp::getOpBundleSizes() {
auto attr = getOpBundleSizesAttr();
return attr;
}
::std::optional< ::mlir::ArrayAttr > AssumeOp::getOpBundleTags() {
auto attr = getOpBundleTagsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
void AssumeOp::setOpBundleSizes(::llvm::ArrayRef<int32_t> attrValue) {
getProperties().op_bundle_sizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value cond) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(cond)>(cond));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, Value cond) {
return create(builder, builder.getLoc(), std::forward<decltype(cond)>(cond));
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value cond, llvm::StringRef tag, ValueRange args) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(cond)>(cond), std::forward<decltype(tag)>(tag), std::forward<decltype(args)>(args));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, Value cond, llvm::StringRef tag, ValueRange args) {
return create(builder, builder.getLoc(), std::forward<decltype(cond)>(cond), std::forward<decltype(tag)>(tag), std::forward<decltype(args)>(args));
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value cond, AssumeAlignTag tag, Value ptr, Value align) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(cond)>(cond), std::forward<decltype(tag)>(tag), std::forward<decltype(ptr)>(ptr), std::forward<decltype(align)>(align));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, Value cond, AssumeAlignTag tag, Value ptr, Value align) {
return create(builder, builder.getLoc(), std::forward<decltype(cond)>(cond), std::forward<decltype(tag)>(tag), std::forward<decltype(ptr)>(ptr), std::forward<decltype(align)>(align));
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value cond, AssumeSeparateStorageTag tag, Value ptr1, Value ptr2) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(cond)>(cond), std::forward<decltype(tag)>(tag), std::forward<decltype(ptr1)>(ptr1), std::forward<decltype(ptr2)>(ptr2));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, Value cond, AssumeSeparateStorageTag tag, Value ptr1, Value ptr2) {
return create(builder, builder.getLoc(), std::forward<decltype(cond)>(cond), std::forward<decltype(tag)>(tag), std::forward<decltype(ptr1)>(ptr1), std::forward<decltype(ptr2)>(ptr2));
}
void AssumeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value cond, ::llvm::ArrayRef<::mlir::ValueRange> op_bundle_operands, /*optional*/::mlir::ArrayAttr op_bundle_tags) {
odsState.addOperands(cond);
for (::mlir::ValueRange range : op_bundle_operands)
odsState.addOperands(range);
{
::llvm::SmallVector<int32_t> rangeSegments;
for (::mlir::ValueRange range : op_bundle_operands)
rangeSegments.push_back(range.size());
auto rangeAttr = odsBuilder.getDenseI32ArrayAttr(rangeSegments);
odsState.getOrAddProperties<Properties>().op_bundle_sizes = rangeAttr; }
if (op_bundle_tags) {
odsState.getOrAddProperties<Properties>().op_bundle_tags = op_bundle_tags;
}
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value cond, ::llvm::ArrayRef<::mlir::ValueRange> op_bundle_operands, /*optional*/::mlir::ArrayAttr op_bundle_tags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(cond)>(cond), std::forward<decltype(op_bundle_operands)>(op_bundle_operands), std::forward<decltype(op_bundle_tags)>(op_bundle_tags));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value cond, ::llvm::ArrayRef<::mlir::ValueRange> op_bundle_operands, /*optional*/::mlir::ArrayAttr op_bundle_tags) {
return create(builder, builder.getLoc(), std::forward<decltype(cond)>(cond), std::forward<decltype(op_bundle_operands)>(op_bundle_operands), std::forward<decltype(op_bundle_tags)>(op_bundle_tags));
}
void AssumeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::llvm::ArrayRef<::mlir::ValueRange> op_bundle_operands, /*optional*/::mlir::ArrayAttr op_bundle_tags) {
odsState.addOperands(cond);
for (::mlir::ValueRange range : op_bundle_operands)
odsState.addOperands(range);
{
::llvm::SmallVector<int32_t> rangeSegments;
for (::mlir::ValueRange range : op_bundle_operands)
rangeSegments.push_back(range.size());
auto rangeAttr = odsBuilder.getDenseI32ArrayAttr(rangeSegments);
odsState.getOrAddProperties<Properties>().op_bundle_sizes = rangeAttr; }
if (op_bundle_tags) {
odsState.getOrAddProperties<Properties>().op_bundle_tags = op_bundle_tags;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::llvm::ArrayRef<::mlir::ValueRange> op_bundle_operands, /*optional*/::mlir::ArrayAttr op_bundle_tags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(cond)>(cond), std::forward<decltype(op_bundle_operands)>(op_bundle_operands), std::forward<decltype(op_bundle_tags)>(op_bundle_tags));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::llvm::ArrayRef<::mlir::ValueRange> op_bundle_operands, /*optional*/::mlir::ArrayAttr op_bundle_tags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(cond)>(cond), std::forward<decltype(op_bundle_operands)>(op_bundle_operands), std::forward<decltype(op_bundle_tags)>(op_bundle_tags));
}
void AssumeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() >= 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<AssumeOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void AssumeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() >= 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
AssumeOp AssumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<AssumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
AssumeOp AssumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult AssumeOp::verifyInvariantsImpl() {
auto tblgen_op_bundle_sizes = getProperties().op_bundle_sizes; (void)tblgen_op_bundle_sizes;
if (!tblgen_op_bundle_sizes) return emitOpError("requires attribute 'op_bundle_sizes'");
auto tblgen_op_bundle_tags = getProperties().op_bundle_tags; (void)tblgen_op_bundle_tags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps3(*this, tblgen_op_bundle_sizes, "op_bundle_sizes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps4(*this, tblgen_op_bundle_tags, "op_bundle_tags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps7(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*this, "op_bundle_sizes", "op_bundle_operands", valueGroup1.size())))
return ::mlir::failure();
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps8(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult AssumeOp::verifyInvariants() {
if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
return ::mlir::success();
return ::mlir::failure();
}
::mlir::ParseResult AssumeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand condRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> condOperands(&condRawOperand, 1); ::llvm::SMLoc condOperandsLoc;
(void)condOperandsLoc;
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> op_bundle_operandsOperands;
llvm::SmallVector<int32_t> op_bundle_operandsOperandGroupSizes;
::llvm::SMLoc op_bundle_operandsOperandsLoc;
(void)op_bundle_operandsOperandsLoc;
::llvm::SmallVector<::mlir::Type, 1> op_bundle_operandsTypes;
::mlir::ArrayAttr op_bundle_tagsAttr;
::mlir::Type condRawType{};
::llvm::ArrayRef<::mlir::Type> condTypes(&condRawType, 1);
condOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(condRawOperand))
return ::mlir::failure();
if (auto optResult = [&]() -> ::mlir::OptionalParseResult {
{
op_bundle_operandsOperandsLoc = parser.getCurrentLocation();
::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> op_bundle_operandsOperandGroups;
::llvm::SmallVector<llvm::SmallVector<::mlir::Type>> op_bundle_operandsTypeGroups;
auto odsResult = parseOpBundles(parser, op_bundle_operandsOperandGroups, op_bundle_operandsTypeGroups, op_bundle_tagsAttr);
if (!odsResult.has_value()) return {};
if (::mlir::failed(*odsResult)) return ::mlir::failure();
for (const auto &subRange : op_bundle_operandsOperandGroups) {
op_bundle_operandsOperands.append(subRange.begin(), subRange.end());
op_bundle_operandsOperandGroupSizes.push_back(subRange.size());
}
for (const auto &subRange : op_bundle_operandsTypeGroups)
op_bundle_operandsTypes.append(subRange.begin(), subRange.end());
if (op_bundle_tagsAttr)
result.getOrAddProperties<AssumeOp::Properties>().op_bundle_tags = op_bundle_tagsAttr;
}
return ::mlir::success();
}(); optResult.has_value() && ::mlir::failed(*optResult)) {
return ::mlir::failure();
} else if (optResult.has_value()) {
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::IntegerType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
condRawType = type;
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
result.getOrAddProperties<AssumeOp::Properties>().op_bundle_sizes = parser.getBuilder().getDenseI32ArrayAttr(op_bundle_operandsOperandGroupSizes);
if (parser.resolveOperands(condOperands, condTypes, condOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(op_bundle_operandsOperands, op_bundle_operandsTypes, op_bundle_operandsOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void AssumeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getCond();
if (((!getOpBundleOperands().empty()) || (!getOpBundleOperands().empty()) || (getOpBundleTagsAttr()))) {
_odsPrinter << ' ';
printOpBundles(_odsPrinter, *this, getOpBundleOperands(), getOpBundleOperands().getTypes(), getOpBundleTagsAttr());
}
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getCond().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::IntegerType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("op_bundle_sizes");
elidedAttrs.push_back("op_bundle_tags");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::AssumeOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::AssumeOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::BitReverseOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
BitReverseOpGenericAdaptorBase::BitReverseOpGenericAdaptorBase(BitReverseOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
BitReverseOpAdaptor::BitReverseOpAdaptor(BitReverseOp op) : BitReverseOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult BitReverseOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult BitReverseOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute BitReverseOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code BitReverseOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> BitReverseOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void BitReverseOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void BitReverseOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult BitReverseOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void BitReverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
BitReverseOp BitReverseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<BitReverseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BitReverseOp BitReverseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void BitReverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in) {
odsState.addOperands(in);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(BitReverseOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
BitReverseOp BitReverseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<BitReverseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BitReverseOp BitReverseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in));
}
void BitReverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
BitReverseOp BitReverseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<BitReverseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BitReverseOp BitReverseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void BitReverseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
BitReverseOp BitReverseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<BitReverseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BitReverseOp BitReverseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void BitReverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(BitReverseOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
BitReverseOp BitReverseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<BitReverseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BitReverseOp BitReverseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void BitReverseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
BitReverseOp BitReverseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<BitReverseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BitReverseOp BitReverseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void BitReverseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(BitReverseOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
BitReverseOp BitReverseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<BitReverseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
BitReverseOp BitReverseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult BitReverseOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult BitReverseOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult BitReverseOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult BitReverseOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void BitReverseOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void BitReverseOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::BitReverseOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ByteSwapOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ByteSwapOpGenericAdaptorBase::ByteSwapOpGenericAdaptorBase(ByteSwapOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
ByteSwapOpAdaptor::ByteSwapOpAdaptor(ByteSwapOp op) : ByteSwapOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ByteSwapOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult ByteSwapOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute ByteSwapOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ByteSwapOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> ByteSwapOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void ByteSwapOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void ByteSwapOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult ByteSwapOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void ByteSwapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
ByteSwapOp ByteSwapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<ByteSwapOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ByteSwapOp ByteSwapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void ByteSwapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in) {
odsState.addOperands(in);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ByteSwapOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ByteSwapOp ByteSwapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<ByteSwapOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ByteSwapOp ByteSwapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in));
}
void ByteSwapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ByteSwapOp ByteSwapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<ByteSwapOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ByteSwapOp ByteSwapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void ByteSwapOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ByteSwapOp ByteSwapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ByteSwapOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ByteSwapOp ByteSwapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ByteSwapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ByteSwapOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ByteSwapOp ByteSwapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ByteSwapOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ByteSwapOp ByteSwapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ByteSwapOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ByteSwapOp ByteSwapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ByteSwapOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ByteSwapOp ByteSwapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ByteSwapOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ByteSwapOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ByteSwapOp ByteSwapOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ByteSwapOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ByteSwapOp ByteSwapOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ByteSwapOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ByteSwapOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ByteSwapOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ByteSwapOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ByteSwapOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void ByteSwapOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ByteSwapOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFAddIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFAddIntrGenericAdaptorBase::ConstrainedFAddIntrGenericAdaptorBase(ConstrainedFAddIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFAddIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFAddIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFAddIntrAdaptor::ConstrainedFAddIntrAdaptor(ConstrainedFAddIntr op) : ConstrainedFAddIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFAddIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fadd' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.fadd' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.fadd' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fadd' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFAddIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFAddIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFAddIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFAddIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFAddIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFAddIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFAddIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFAddIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFAddIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFAddIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFAddIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFAddIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFAddIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFAddIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFAddIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConstrainedFAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFAddIntr ConstrainedFAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFAddIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFAddIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConstrainedFAddIntr::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConstrainedFAddIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_1RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_1Operands(&arg_1RawOperand, 1); ::llvm::SMLoc arg_1OperandsLoc;
(void)arg_1OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_1OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_1RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFAddIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFAddIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
result.addTypes(arg_0Types[0]);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_1Operands, arg_0Types[0], arg_1OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFAddIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_1();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ConstrainedFAddIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFAddIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFAddIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFDivIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFDivIntrGenericAdaptorBase::ConstrainedFDivIntrGenericAdaptorBase(ConstrainedFDivIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFDivIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFDivIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFDivIntrAdaptor::ConstrainedFDivIntrAdaptor(ConstrainedFDivIntr op) : ConstrainedFDivIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFDivIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fdiv' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.fdiv' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.fdiv' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fdiv' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFDivIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFDivIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFDivIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFDivIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFDivIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFDivIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFDivIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFDivIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFDivIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFDivIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFDivIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFDivIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFDivIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFDivIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFDivIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFDivIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFDivIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFDivIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConstrainedFDivIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFDivIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFDivIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFDivIntr ConstrainedFDivIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFDivIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFDivIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConstrainedFDivIntr::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConstrainedFDivIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_1RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_1Operands(&arg_1RawOperand, 1); ::llvm::SMLoc arg_1OperandsLoc;
(void)arg_1OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_1OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_1RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFDivIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFDivIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
result.addTypes(arg_0Types[0]);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_1Operands, arg_0Types[0], arg_1OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFDivIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_1();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ConstrainedFDivIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFDivIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFDivIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFMAIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFMAIntrGenericAdaptorBase::ConstrainedFMAIntrGenericAdaptorBase(ConstrainedFMAIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFMAIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFMAIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFMAIntrAdaptor::ConstrainedFMAIntrAdaptor(ConstrainedFMAIntr op) : ConstrainedFMAIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFMAIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fma' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.fma' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.fma' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fma' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMAIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFMAIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFMAIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFMAIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFMAIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFMAIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFMAIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMAIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFMAIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFMAIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFMAIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFMAIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFMAIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMAIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMAIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFMAIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFMAIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMAIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConstrainedFMAIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMAIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMAIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMAIntr ConstrainedFMAIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFMAIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMAIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConstrainedFMAIntr::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConstrainedFMAIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_1RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_1Operands(&arg_1RawOperand, 1); ::llvm::SMLoc arg_1OperandsLoc;
(void)arg_1OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_2RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_2Operands(&arg_2RawOperand, 1); ::llvm::SMLoc arg_2OperandsLoc;
(void)arg_2OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_1OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_1RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_2OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_2RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFMAIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFMAIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
result.addTypes(arg_0Types[0]);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_1Operands, arg_0Types[0], arg_1OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_2Operands, arg_0Types[0], arg_2OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFMAIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_1();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_2();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ConstrainedFMAIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFMAIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFMAIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFMulAddIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFMulAddIntrGenericAdaptorBase::ConstrainedFMulAddIntrGenericAdaptorBase(ConstrainedFMulAddIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFMulAddIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFMulAddIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFMulAddIntrAdaptor::ConstrainedFMulAddIntrAdaptor(ConstrainedFMulAddIntr op) : ConstrainedFMulAddIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFMulAddIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fmuladd' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.fmuladd' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.fmuladd' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fmuladd' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMulAddIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFMulAddIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFMulAddIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFMulAddIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFMulAddIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFMulAddIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFMulAddIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMulAddIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFMulAddIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFMulAddIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFMulAddIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFMulAddIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFMulAddIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.addOperands(arg_2);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::Value arg_2, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(arg_2)>(arg_2), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFMulAddIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFMulAddIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConstrainedFMulAddIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulAddIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulAddIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulAddIntr ConstrainedFMulAddIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFMulAddIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMulAddIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConstrainedFMulAddIntr::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConstrainedFMulAddIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_1RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_1Operands(&arg_1RawOperand, 1); ::llvm::SMLoc arg_1OperandsLoc;
(void)arg_1OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_2RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_2Operands(&arg_2RawOperand, 1); ::llvm::SMLoc arg_2OperandsLoc;
(void)arg_2OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_1OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_1RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_2OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_2RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFMulAddIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFMulAddIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
result.addTypes(arg_0Types[0]);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_1Operands, arg_0Types[0], arg_1OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_2Operands, arg_0Types[0], arg_2OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFMulAddIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_1();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_2();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ConstrainedFMulAddIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFMulAddIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFMulAddIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFMulIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFMulIntrGenericAdaptorBase::ConstrainedFMulIntrGenericAdaptorBase(ConstrainedFMulIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFMulIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFMulIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFMulIntrAdaptor::ConstrainedFMulIntrAdaptor(ConstrainedFMulIntr op) : ConstrainedFMulIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFMulIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fmul' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.fmul' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.fmul' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fmul' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMulIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFMulIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFMulIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFMulIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFMulIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFMulIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFMulIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMulIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFMulIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFMulIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFMulIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFMulIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFMulIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFMulIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFMulIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConstrainedFMulIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFMulIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFMulIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFMulIntr ConstrainedFMulIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFMulIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFMulIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConstrainedFMulIntr::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConstrainedFMulIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_1RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_1Operands(&arg_1RawOperand, 1); ::llvm::SMLoc arg_1OperandsLoc;
(void)arg_1OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_1OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_1RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFMulIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFMulIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
result.addTypes(arg_0Types[0]);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_1Operands, arg_0Types[0], arg_1OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFMulIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_1();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ConstrainedFMulIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFMulIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFMulIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFPExtIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFPExtIntrGenericAdaptorBase::ConstrainedFPExtIntrGenericAdaptorBase(ConstrainedFPExtIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FPExceptionBehavior ConstrainedFPExtIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFPExtIntrAdaptor::ConstrainedFPExtIntrAdaptor(ConstrainedFPExtIntr op) : ConstrainedFPExtIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFPExtIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fpext' op requires attribute 'fpExceptionBehavior'");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fpext' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFPExtIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFPExtIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFPExtIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFPExtIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
return std::nullopt;
}
void ConstrainedFPExtIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
}
void ConstrainedFPExtIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
}
::llvm::LogicalResult ConstrainedFPExtIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFPExtIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFPExtIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFPExtIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFPExtIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFPExtIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPExtIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPExtIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPExtIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPExtIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPExtIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPExtIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPExtIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPExtIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFPExtIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPExtIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFPExtIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPExtIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPExtIntr ConstrainedFPExtIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFPExtIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFPExtIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult ConstrainedFPExtIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
::llvm::SmallVector<::mlir::Type, 1> allResultTypes;
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFPExtIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
if (parser.parseKeyword("to"))
return ::mlir::failure();
if (parser.parseTypeList(allResultTypes))
return ::mlir::failure();
result.addTypes(allResultTypes);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFPExtIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "to";
_odsPrinter << ' ';
_odsPrinter << getOperation()->getResultTypes();
}
void ConstrainedFPExtIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFPExtIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFPExtIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFPTruncIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFPTruncIntrGenericAdaptorBase::ConstrainedFPTruncIntrGenericAdaptorBase(ConstrainedFPTruncIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFPTruncIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFPTruncIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFPTruncIntrAdaptor::ConstrainedFPTruncIntrAdaptor(ConstrainedFPTruncIntr op) : ConstrainedFPTruncIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFPTruncIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fptrunc' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.fptrunc' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.fptrunc' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fptrunc' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFPTruncIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFPTruncIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFPTruncIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFPTruncIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFPTruncIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFPTruncIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFPTruncIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFPTruncIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFPTruncIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFPTruncIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFPTruncIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFPTruncIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFPTruncIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFPTruncIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPTruncIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPTruncIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPTruncIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPTruncIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPTruncIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPTruncIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPTruncIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFPTruncIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFPTruncIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPTruncIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFPTruncIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFPTruncIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFPTruncIntr ConstrainedFPTruncIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFPTruncIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFPTruncIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult ConstrainedFPTruncIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
::llvm::SmallVector<::mlir::Type, 1> allResultTypes;
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFPTruncIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFPTruncIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
if (parser.parseKeyword("to"))
return ::mlir::failure();
if (parser.parseTypeList(allResultTypes))
return ::mlir::failure();
result.addTypes(allResultTypes);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFPTruncIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "to";
_odsPrinter << ' ';
_odsPrinter << getOperation()->getResultTypes();
}
void ConstrainedFPTruncIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFPTruncIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFPTruncIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFRemIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFRemIntrGenericAdaptorBase::ConstrainedFRemIntrGenericAdaptorBase(ConstrainedFRemIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFRemIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFRemIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFRemIntrAdaptor::ConstrainedFRemIntrAdaptor(ConstrainedFRemIntr op) : ConstrainedFRemIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFRemIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.frem' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.frem' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.frem' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.frem' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFRemIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFRemIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFRemIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFRemIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFRemIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFRemIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFRemIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFRemIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFRemIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFRemIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFRemIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFRemIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFRemIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFRemIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFRemIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFRemIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFRemIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFRemIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConstrainedFRemIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFRemIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFRemIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFRemIntr ConstrainedFRemIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFRemIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFRemIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConstrainedFRemIntr::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConstrainedFRemIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_1RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_1Operands(&arg_1RawOperand, 1); ::llvm::SMLoc arg_1OperandsLoc;
(void)arg_1OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_1OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_1RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFRemIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFRemIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
result.addTypes(arg_0Types[0]);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_1Operands, arg_0Types[0], arg_1OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFRemIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_1();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ConstrainedFRemIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFRemIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFRemIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedFSubIntr definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedFSubIntrGenericAdaptorBase::ConstrainedFSubIntrGenericAdaptorBase(ConstrainedFSubIntr op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedFSubIntrGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFSubIntrGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedFSubIntrAdaptor::ConstrainedFSubIntrAdaptor(ConstrainedFSubIntr op) : ConstrainedFSubIntrGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedFSubIntrAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.fsub' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.fsub' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.fsub' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.fsub' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFSubIntr::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedFSubIntr::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedFSubIntr::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedFSubIntr::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedFSubIntr::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedFSubIntr::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedFSubIntr::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFSubIntr::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFSubIntr::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedFSubIntr::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedFSubIntr::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedFSubIntr::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFSubIntr::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFSubIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFSubIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.addOperands(arg_1);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::Value arg_1, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(arg_1)>(arg_1), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFSubIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedFSubIntr::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFSubIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ConstrainedFSubIntr::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ConstrainedFSubIntr::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedFSubIntr>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedFSubIntr ConstrainedFSubIntr::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedFSubIntr::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedFSubIntr::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ConstrainedFSubIntr::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ConstrainedFSubIntr::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand arg_1RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_1Operands(&arg_1RawOperand, 1); ::llvm::SMLoc arg_1OperandsLoc;
(void)arg_1OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
arg_1OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_1RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFSubIntr::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedFSubIntr::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
result.addTypes(arg_0Types[0]);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(arg_1Operands, arg_0Types[0], arg_1OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedFSubIntr::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getArg_1();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ConstrainedFSubIntr::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedFSubIntr)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedFSubIntrGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedSIToFP definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedSIToFPGenericAdaptorBase::ConstrainedSIToFPGenericAdaptorBase(ConstrainedSIToFP op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedSIToFPGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedSIToFPGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedSIToFPAdaptor::ConstrainedSIToFPAdaptor(ConstrainedSIToFP op) : ConstrainedSIToFPGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedSIToFPAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.sitofp' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.sitofp' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.sitofp' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.sitofp' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedSIToFP::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedSIToFP::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedSIToFP::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedSIToFP::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedSIToFP::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedSIToFP::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedSIToFP::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedSIToFP::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedSIToFP::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedSIToFP::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedSIToFP::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedSIToFP::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedSIToFP::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedSIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedSIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedSIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedSIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedSIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedSIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedSIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedSIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedSIToFP::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedSIToFP::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedSIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedSIToFP::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedSIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedSIToFP ConstrainedSIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedSIToFP::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedSIToFP::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult ConstrainedSIToFP::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
::llvm::SmallVector<::mlir::Type, 1> allResultTypes;
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedSIToFP::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedSIToFP::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
if (parser.parseKeyword("to"))
return ::mlir::failure();
if (parser.parseTypeList(allResultTypes))
return ::mlir::failure();
result.addTypes(allResultTypes);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedSIToFP::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "to";
_odsPrinter << ' ';
_odsPrinter << getOperation()->getResultTypes();
}
void ConstrainedSIToFP::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedSIToFP)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedSIToFPGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ConstrainedUIToFP definitions
//===----------------------------------------------------------------------===//
namespace detail {
ConstrainedUIToFPGenericAdaptorBase::ConstrainedUIToFPGenericAdaptorBase(ConstrainedUIToFP op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::RoundingMode ConstrainedUIToFPGenericAdaptorBase::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedUIToFPGenericAdaptorBase::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
} // namespace detail
ConstrainedUIToFPAdaptor::ConstrainedUIToFPAdaptor(ConstrainedUIToFP op) : ConstrainedUIToFPGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ConstrainedUIToFPAdaptor::verify(::mlir::Location loc) {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitError(loc, "'llvm.intr.experimental.constrained.uitofp' op requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitError(loc, "'llvm.intr.experimental.constrained.uitofp' op requires attribute 'roundingmode'");
if (tblgen_roundingmode && !(((::llvm::isa<::mlir::LLVM::RoundingModeAttr>(tblgen_roundingmode))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_roundingmode).getInt() >= 0))))
return emitError(loc, "'llvm.intr.experimental.constrained.uitofp' op attribute 'roundingmode' failed to satisfy constraint: LLVM Rounding Mode whose minimum value is 0");
if (tblgen_fpExceptionBehavior && !((::llvm::isa<::mlir::LLVM::FPExceptionBehaviorAttr>(tblgen_fpExceptionBehavior))))
return emitError(loc, "'llvm.intr.experimental.constrained.uitofp' op attribute 'fpExceptionBehavior' failed to satisfy constraint: LLVM Exception Behavior");
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedUIToFP::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fpExceptionBehavior;
auto attr = dict.get("fpExceptionBehavior");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fpExceptionBehavior` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.roundingmode;
auto attr = dict.get("roundingmode");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `roundingmode` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ConstrainedUIToFP::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fpExceptionBehavior;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fpExceptionBehavior",
propStorage));
}
{
const auto &propStorage = prop.roundingmode;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("roundingmode",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ConstrainedUIToFP::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fpExceptionBehavior.getAsOpaquePointer()),
llvm::hash_value(prop.roundingmode.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ConstrainedUIToFP::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fpExceptionBehavior")
return prop.fpExceptionBehavior;
if (name == "roundingmode")
return prop.roundingmode;
return std::nullopt;
}
void ConstrainedUIToFP::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fpExceptionBehavior") {
prop.fpExceptionBehavior = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fpExceptionBehavior)>>(value);
return;
}
if (name == "roundingmode") {
prop.roundingmode = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.roundingmode)>>(value);
return;
}
}
void ConstrainedUIToFP::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fpExceptionBehavior) attrs.append("fpExceptionBehavior", prop.fpExceptionBehavior);
if (prop.roundingmode) attrs.append("roundingmode", prop.roundingmode);
}
::llvm::LogicalResult ConstrainedUIToFP::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFpExceptionBehaviorAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(attr, "fpExceptionBehavior", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRoundingmodeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(attr, "roundingmode", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedUIToFP::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.fpExceptionBehavior)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.roundingmode)))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedUIToFP::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.fpExceptionBehavior);
writer.writeAttribute(prop.roundingmode);
}
::mlir::LLVM::RoundingMode ConstrainedUIToFP::getRoundingmode() {
auto attr = getRoundingmodeAttr();
return attr.getValue();
}
::mlir::LLVM::FPExceptionBehavior ConstrainedUIToFP::getFpExceptionBehavior() {
auto attr = getFpExceptionBehaviorAttr();
return attr.getValue();
}
void ConstrainedUIToFP::setRoundingmode(::mlir::LLVM::RoundingMode attrValue) {
getProperties().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedUIToFP::setFpExceptionBehavior(::mlir::LLVM::FPExceptionBehavior attrValue) {
getProperties().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ConstrainedUIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
odsState.addTypes(res);
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedUIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedUIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = roundingmode;
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = fpExceptionBehavior;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedUIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingModeAttr roundingmode, ::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedUIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
odsState.addTypes(res);
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedUIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedUIToFP::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
odsState.addOperands(arg_0);
odsState.getOrAddProperties<Properties>().roundingmode = ::mlir::LLVM::RoundingModeAttr::get(odsBuilder.getContext(), roundingmode);
odsState.getOrAddProperties<Properties>().fpExceptionBehavior = ::mlir::LLVM::FPExceptionBehaviorAttr::get(odsBuilder.getContext(), fpExceptionBehavior);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
auto __res__ = ::llvm::dyn_cast<ConstrainedUIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_0, ::mlir::LLVM::RoundingMode roundingmode, ::mlir::LLVM::FPExceptionBehavior fpExceptionBehavior) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_0)>(arg_0), std::forward<decltype(roundingmode)>(roundingmode), std::forward<decltype(fpExceptionBehavior)>(fpExceptionBehavior));
}
void ConstrainedUIToFP::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ConstrainedUIToFP::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedUIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ConstrainedUIToFP::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ConstrainedUIToFP>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ConstrainedUIToFP ConstrainedUIToFP::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ConstrainedUIToFP::verifyInvariantsImpl() {
auto tblgen_fpExceptionBehavior = getProperties().fpExceptionBehavior; (void)tblgen_fpExceptionBehavior;
if (!tblgen_fpExceptionBehavior) return emitOpError("requires attribute 'fpExceptionBehavior'");
auto tblgen_roundingmode = getProperties().roundingmode; (void)tblgen_roundingmode;
if (!tblgen_roundingmode) return emitOpError("requires attribute 'roundingmode'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps5(*this, tblgen_roundingmode, "roundingmode")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps6(*this, tblgen_fpExceptionBehavior, "fpExceptionBehavior")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ConstrainedUIToFP::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult ConstrainedUIToFP::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_0RawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_0Operands(&arg_0RawOperand, 1); ::llvm::SMLoc arg_0OperandsLoc;
(void)arg_0OperandsLoc;
::mlir::LLVM::RoundingModeAttr roundingmodeAttr;
::mlir::LLVM::FPExceptionBehaviorAttr fpExceptionBehaviorAttr;
::mlir::Type arg_0RawType{};
::llvm::ArrayRef<::mlir::Type> arg_0Types(&arg_0RawType, 1);
::llvm::SmallVector<::mlir::Type, 1> allResultTypes;
arg_0OperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_0RawOperand))
return ::mlir::failure();
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"towardzero","tonearest","upward","downward","tonearestaway","dynamic","invalid"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"roundingmode", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'roundingmode' [towardzero, tonearest, upward, downward, tonearestaway, dynamic, invalid]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeRoundingMode(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "roundingmode attribute specification: \"" << attrStr << '"';;
roundingmodeAttr = ::mlir::LLVM::RoundingModeAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedUIToFP::Properties>().roundingmode = roundingmodeAttr;
}
}
{
::llvm::StringRef attrStr;
::mlir::NamedAttrList attrStorage;
auto loc = parser.getCurrentLocation();
if (parser.parseOptionalKeyword(&attrStr, {"ignore","maytrap","strict"})) {
::mlir::StringAttr attrVal;
::mlir::OptionalParseResult parseResult =
parser.parseOptionalAttribute(attrVal,
parser.getBuilder().getNoneType(),
"fpExceptionBehavior", attrStorage);
if (parseResult.has_value()) {
if (failed(*parseResult))
return ::mlir::failure();
attrStr = attrVal.getValue();
} else {
return parser.emitError(loc, "expected string or keyword containing one of the following enum values for attribute 'fpExceptionBehavior' [ignore, maytrap, strict]");
}
}
if (!attrStr.empty()) {
auto attrOptional = ::mlir::LLVM::symbolizeFPExceptionBehavior(attrStr);
if (!attrOptional)
return parser.emitError(loc, "invalid ")
<< "fpExceptionBehavior attribute specification: \"" << attrStr << '"';;
fpExceptionBehaviorAttr = ::mlir::LLVM::FPExceptionBehaviorAttr::get(parser.getBuilder().getContext(), *attrOptional);
result.getOrAddProperties<ConstrainedUIToFP::Properties>().fpExceptionBehavior = fpExceptionBehaviorAttr;
}
}
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
arg_0RawType = type;
}
if (parser.parseKeyword("to"))
return ::mlir::failure();
if (parser.parseTypeList(allResultTypes))
return ::mlir::failure();
result.addTypes(allResultTypes);
if (parser.resolveOperands(arg_0Operands, arg_0Types, arg_0OperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ConstrainedUIToFP::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArg_0();
_odsPrinter << ' ';
{
auto caseValue = getRoundingmode();
auto caseValueStr = stringifyRoundingMode(caseValue);
_odsPrinter << caseValueStr;
}
_odsPrinter << ' ';
{
auto caseValue = getFpExceptionBehavior();
auto caseValueStr = stringifyFPExceptionBehavior(caseValue);
_odsPrinter << caseValueStr;
}
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("roundingmode");
elidedAttrs.push_back("fpExceptionBehavior");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getArg_0().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "to";
_odsPrinter << ' ';
_odsPrinter << getOperation()->getResultTypes();
}
void ConstrainedUIToFP::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ConstrainedUIToFP)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ConstrainedUIToFPGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CopySignOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CopySignOpGenericAdaptorBase::CopySignOpGenericAdaptorBase(CopySignOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr CopySignOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags CopySignOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
CopySignOpAdaptor::CopySignOpAdaptor(CopySignOp op) : CopySignOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CopySignOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.copysign' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult CopySignOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute CopySignOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CopySignOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> CopySignOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void CopySignOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void CopySignOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult CopySignOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult CopySignOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void CopySignOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags CopySignOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void CopySignOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CopySignOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CopySignOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CopySignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CopySignOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CopySignOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CopySignOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CopySignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CopySignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CopySignOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CopySignOp CopySignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CopySignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CopySignOp CopySignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CopySignOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult CopySignOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CopySignOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult CopySignOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult CopySignOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CopySignOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void CopySignOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CopySignOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::CopySignOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroAlignOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroAlignOpGenericAdaptorBase::CoroAlignOpGenericAdaptorBase(CoroAlignOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroAlignOpAdaptor::CoroAlignOpAdaptor(CoroAlignOp op) : CoroAlignOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroAlignOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroAlignOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroAlignOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroAlignOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroAlignOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroAlignOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroAlignOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroAlignOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroAlignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res) {
odsState.addTypes(res);
}
CoroAlignOp CoroAlignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res));
auto __res__ = ::llvm::dyn_cast<CoroAlignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroAlignOp CoroAlignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res));
}
void CoroAlignOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroAlignOp CoroAlignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes));
auto __res__ = ::llvm::dyn_cast<CoroAlignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroAlignOp CoroAlignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes));
}
void CoroAlignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroAlignOp CoroAlignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroAlignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroAlignOp CoroAlignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroAlignOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroAlignOp CoroAlignOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroAlignOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroAlignOp CoroAlignOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroAlignOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroAlignOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroAlignOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
result.addTypes(resTypes);
return ::mlir::success();
}
void CoroAlignOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroAlignOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroBeginOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroBeginOpGenericAdaptorBase::CoroBeginOpGenericAdaptorBase(CoroBeginOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroBeginOpAdaptor::CoroBeginOpAdaptor(CoroBeginOp op) : CoroBeginOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroBeginOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroBeginOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroBeginOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroBeginOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroBeginOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroBeginOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroBeginOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroBeginOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroBeginOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value token, ::mlir::Value mem) {
odsState.addOperands(token);
odsState.addOperands(mem);
odsState.addTypes(res);
}
CoroBeginOp CoroBeginOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value token, ::mlir::Value mem) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(token)>(token), std::forward<decltype(mem)>(mem));
auto __res__ = ::llvm::dyn_cast<CoroBeginOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroBeginOp CoroBeginOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value token, ::mlir::Value mem) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(token)>(token), std::forward<decltype(mem)>(mem));
}
void CoroBeginOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value token, ::mlir::Value mem) {
odsState.addOperands(token);
odsState.addOperands(mem);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroBeginOp CoroBeginOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value token, ::mlir::Value mem) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(token)>(token), std::forward<decltype(mem)>(mem));
auto __res__ = ::llvm::dyn_cast<CoroBeginOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroBeginOp CoroBeginOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value token, ::mlir::Value mem) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(token)>(token), std::forward<decltype(mem)>(mem));
}
void CoroBeginOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroBeginOp CoroBeginOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroBeginOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroBeginOp CoroBeginOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroBeginOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroBeginOp CoroBeginOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroBeginOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroBeginOp CoroBeginOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroBeginOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps9(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroBeginOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroBeginOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand tokenRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> tokenOperands(&tokenRawOperand, 1); ::llvm::SMLoc tokenOperandsLoc;
(void)tokenOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand memRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> memOperands(&memRawOperand, 1); ::llvm::SMLoc memOperandsLoc;
(void)memOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
tokenOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(tokenRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
memOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(memRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(::llvm::concat<const ::mlir::OpAsmParser::UnresolvedOperand>(tokenOperands, memOperands), allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroBeginOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getToken();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getMem();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroBeginOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroEndOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroEndOpGenericAdaptorBase::CoroEndOpGenericAdaptorBase(CoroEndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroEndOpAdaptor::CoroEndOpAdaptor(CoroEndOp op) : CoroEndOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroEndOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroEndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroEndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroEndOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroEndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroEndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroEndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroEndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value handle, ::mlir::Value unwind, ::mlir::Value retvals) {
odsState.addOperands(handle);
odsState.addOperands(unwind);
odsState.addOperands(retvals);
odsState.addTypes(res);
}
CoroEndOp CoroEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value handle, ::mlir::Value unwind, ::mlir::Value retvals) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(handle)>(handle), std::forward<decltype(unwind)>(unwind), std::forward<decltype(retvals)>(retvals));
auto __res__ = ::llvm::dyn_cast<CoroEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroEndOp CoroEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value handle, ::mlir::Value unwind, ::mlir::Value retvals) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(handle)>(handle), std::forward<decltype(unwind)>(unwind), std::forward<decltype(retvals)>(retvals));
}
void CoroEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value unwind, ::mlir::Value retvals) {
odsState.addOperands(handle);
odsState.addOperands(unwind);
odsState.addOperands(retvals);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroEndOp CoroEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value unwind, ::mlir::Value retvals) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle), std::forward<decltype(unwind)>(unwind), std::forward<decltype(retvals)>(retvals));
auto __res__ = ::llvm::dyn_cast<CoroEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroEndOp CoroEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value unwind, ::mlir::Value retvals) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle), std::forward<decltype(unwind)>(unwind), std::forward<decltype(retvals)>(retvals));
}
void CoroEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroEndOp CoroEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroEndOp CoroEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroEndOp CoroEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroEndOp CoroEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroEndOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps7(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps9(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroEndOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroEndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand handleRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> handleOperands(&handleRawOperand, 1); ::llvm::SMLoc handleOperandsLoc;
(void)handleOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand unwindRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> unwindOperands(&unwindRawOperand, 1); ::llvm::SMLoc unwindOperandsLoc;
(void)unwindOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand retvalsRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> retvalsOperands(&retvalsRawOperand, 1); ::llvm::SMLoc retvalsOperandsLoc;
(void)retvalsOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
handleOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(handleRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
unwindOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(unwindRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
retvalsOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(retvalsRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(::llvm::concat<const ::mlir::OpAsmParser::UnresolvedOperand>(handleOperands, unwindOperands, retvalsOperands), allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroEndOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getHandle();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getUnwind();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getRetvals();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroEndOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroFreeOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroFreeOpGenericAdaptorBase::CoroFreeOpGenericAdaptorBase(CoroFreeOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroFreeOpAdaptor::CoroFreeOpAdaptor(CoroFreeOp op) : CoroFreeOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroFreeOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroFreeOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroFreeOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroFreeOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroFreeOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroFreeOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroFreeOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroFreeOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroFreeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value id, ::mlir::Value handle) {
odsState.addOperands(id);
odsState.addOperands(handle);
odsState.addTypes(res);
}
CoroFreeOp CoroFreeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value id, ::mlir::Value handle) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(id)>(id), std::forward<decltype(handle)>(handle));
auto __res__ = ::llvm::dyn_cast<CoroFreeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroFreeOp CoroFreeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value id, ::mlir::Value handle) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(id)>(id), std::forward<decltype(handle)>(handle));
}
void CoroFreeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value id, ::mlir::Value handle) {
odsState.addOperands(id);
odsState.addOperands(handle);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroFreeOp CoroFreeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value id, ::mlir::Value handle) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(id)>(id), std::forward<decltype(handle)>(handle));
auto __res__ = ::llvm::dyn_cast<CoroFreeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroFreeOp CoroFreeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value id, ::mlir::Value handle) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(id)>(id), std::forward<decltype(handle)>(handle));
}
void CoroFreeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroFreeOp CoroFreeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroFreeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroFreeOp CoroFreeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroFreeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroFreeOp CoroFreeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroFreeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroFreeOp CoroFreeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroFreeOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps9(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroFreeOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroFreeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand idRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> idOperands(&idRawOperand, 1); ::llvm::SMLoc idOperandsLoc;
(void)idOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand handleRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> handleOperands(&handleRawOperand, 1); ::llvm::SMLoc handleOperandsLoc;
(void)handleOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
idOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(idRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
handleOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(handleRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(::llvm::concat<const ::mlir::OpAsmParser::UnresolvedOperand>(idOperands, handleOperands), allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroFreeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getId();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getHandle();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroFreeOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroIdOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroIdOpGenericAdaptorBase::CoroIdOpGenericAdaptorBase(CoroIdOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroIdOpAdaptor::CoroIdOpAdaptor(CoroIdOp op) : CoroIdOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroIdOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroIdOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroIdOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroIdOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroIdOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroIdOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroIdOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroIdOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroIdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value align, ::mlir::Value promise, ::mlir::Value coroaddr, ::mlir::Value fnaddrs) {
odsState.addOperands(align);
odsState.addOperands(promise);
odsState.addOperands(coroaddr);
odsState.addOperands(fnaddrs);
odsState.addTypes(res);
}
CoroIdOp CoroIdOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value align, ::mlir::Value promise, ::mlir::Value coroaddr, ::mlir::Value fnaddrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(align)>(align), std::forward<decltype(promise)>(promise), std::forward<decltype(coroaddr)>(coroaddr), std::forward<decltype(fnaddrs)>(fnaddrs));
auto __res__ = ::llvm::dyn_cast<CoroIdOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroIdOp CoroIdOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value align, ::mlir::Value promise, ::mlir::Value coroaddr, ::mlir::Value fnaddrs) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(align)>(align), std::forward<decltype(promise)>(promise), std::forward<decltype(coroaddr)>(coroaddr), std::forward<decltype(fnaddrs)>(fnaddrs));
}
void CoroIdOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value align, ::mlir::Value promise, ::mlir::Value coroaddr, ::mlir::Value fnaddrs) {
odsState.addOperands(align);
odsState.addOperands(promise);
odsState.addOperands(coroaddr);
odsState.addOperands(fnaddrs);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroIdOp CoroIdOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value align, ::mlir::Value promise, ::mlir::Value coroaddr, ::mlir::Value fnaddrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(align)>(align), std::forward<decltype(promise)>(promise), std::forward<decltype(coroaddr)>(coroaddr), std::forward<decltype(fnaddrs)>(fnaddrs));
auto __res__ = ::llvm::dyn_cast<CoroIdOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroIdOp CoroIdOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value align, ::mlir::Value promise, ::mlir::Value coroaddr, ::mlir::Value fnaddrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(align)>(align), std::forward<decltype(promise)>(promise), std::forward<decltype(coroaddr)>(coroaddr), std::forward<decltype(fnaddrs)>(fnaddrs));
}
void CoroIdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroIdOp CoroIdOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroIdOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroIdOp CoroIdOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroIdOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroIdOp CoroIdOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroIdOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroIdOp CoroIdOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroIdOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroIdOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroIdOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand alignRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> alignOperands(&alignRawOperand, 1); ::llvm::SMLoc alignOperandsLoc;
(void)alignOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand promiseRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> promiseOperands(&promiseRawOperand, 1); ::llvm::SMLoc promiseOperandsLoc;
(void)promiseOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand coroaddrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> coroaddrOperands(&coroaddrRawOperand, 1); ::llvm::SMLoc coroaddrOperandsLoc;
(void)coroaddrOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand fnaddrsRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> fnaddrsOperands(&fnaddrsRawOperand, 1); ::llvm::SMLoc fnaddrsOperandsLoc;
(void)fnaddrsOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
alignOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(alignRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
promiseOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(promiseRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
coroaddrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(coroaddrRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
fnaddrsOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(fnaddrsRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(::llvm::concat<const ::mlir::OpAsmParser::UnresolvedOperand>(alignOperands, promiseOperands, coroaddrOperands, fnaddrsOperands), allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroIdOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getAlign();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getPromise();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getCoroaddr();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getFnaddrs();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroIdOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroPromiseOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroPromiseOpGenericAdaptorBase::CoroPromiseOpGenericAdaptorBase(CoroPromiseOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroPromiseOpAdaptor::CoroPromiseOpAdaptor(CoroPromiseOp op) : CoroPromiseOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroPromiseOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroPromiseOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroPromiseOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroPromiseOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroPromiseOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroPromiseOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroPromiseOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroPromiseOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroPromiseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value handle, ::mlir::Value align, ::mlir::Value from) {
odsState.addOperands(handle);
odsState.addOperands(align);
odsState.addOperands(from);
odsState.addTypes(res);
}
CoroPromiseOp CoroPromiseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value handle, ::mlir::Value align, ::mlir::Value from) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(handle)>(handle), std::forward<decltype(align)>(align), std::forward<decltype(from)>(from));
auto __res__ = ::llvm::dyn_cast<CoroPromiseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroPromiseOp CoroPromiseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value handle, ::mlir::Value align, ::mlir::Value from) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(handle)>(handle), std::forward<decltype(align)>(align), std::forward<decltype(from)>(from));
}
void CoroPromiseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value align, ::mlir::Value from) {
odsState.addOperands(handle);
odsState.addOperands(align);
odsState.addOperands(from);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroPromiseOp CoroPromiseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value align, ::mlir::Value from) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle), std::forward<decltype(align)>(align), std::forward<decltype(from)>(from));
auto __res__ = ::llvm::dyn_cast<CoroPromiseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroPromiseOp CoroPromiseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value handle, ::mlir::Value align, ::mlir::Value from) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle), std::forward<decltype(align)>(align), std::forward<decltype(from)>(from));
}
void CoroPromiseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroPromiseOp CoroPromiseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroPromiseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroPromiseOp CoroPromiseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroPromiseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroPromiseOp CoroPromiseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroPromiseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroPromiseOp CoroPromiseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroPromiseOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps7(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroPromiseOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroPromiseOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand handleRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> handleOperands(&handleRawOperand, 1); ::llvm::SMLoc handleOperandsLoc;
(void)handleOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand alignRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> alignOperands(&alignRawOperand, 1); ::llvm::SMLoc alignOperandsLoc;
(void)alignOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand fromRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> fromOperands(&fromRawOperand, 1); ::llvm::SMLoc fromOperandsLoc;
(void)fromOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
handleOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(handleRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
alignOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(alignRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
fromOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(fromRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(::llvm::concat<const ::mlir::OpAsmParser::UnresolvedOperand>(handleOperands, alignOperands, fromOperands), allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroPromiseOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getHandle();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getAlign();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getFrom();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroPromiseOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroResumeOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroResumeOpGenericAdaptorBase::CoroResumeOpGenericAdaptorBase(CoroResumeOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroResumeOpAdaptor::CoroResumeOpAdaptor(CoroResumeOp op) : CoroResumeOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroResumeOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroResumeOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroResumeOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroResumeOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroResumeOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroResumeOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroResumeOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroResumeOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroResumeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value handle) {
odsState.addOperands(handle);
}
CoroResumeOp CoroResumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value handle) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(handle)>(handle));
auto __res__ = ::llvm::dyn_cast<CoroResumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroResumeOp CoroResumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value handle) {
return create(builder, builder.getLoc(), std::forward<decltype(handle)>(handle));
}
void CoroResumeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
odsState.addOperands(handle);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroResumeOp CoroResumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle));
auto __res__ = ::llvm::dyn_cast<CoroResumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroResumeOp CoroResumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle));
}
void CoroResumeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroResumeOp CoroResumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroResumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroResumeOp CoroResumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroResumeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroResumeOp CoroResumeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroResumeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroResumeOp CoroResumeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroResumeOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroResumeOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroResumeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand handleRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> handleOperands(&handleRawOperand, 1); ::llvm::SMLoc handleOperandsLoc;
(void)handleOperandsLoc;
::mlir::Type handleRawType{};
::llvm::ArrayRef<::mlir::Type> handleTypes(&handleRawType, 1);
handleOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(handleRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(handleRawType))
return ::mlir::failure();
if (parser.resolveOperands(handleOperands, handleTypes, handleOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroResumeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getHandle();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getHandle().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroResumeOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroSaveOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroSaveOpGenericAdaptorBase::CoroSaveOpGenericAdaptorBase(CoroSaveOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroSaveOpAdaptor::CoroSaveOpAdaptor(CoroSaveOp op) : CoroSaveOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroSaveOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroSaveOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroSaveOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroSaveOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroSaveOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroSaveOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroSaveOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroSaveOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroSaveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value handle) {
odsState.addOperands(handle);
odsState.addTypes(res);
}
CoroSaveOp CoroSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value handle) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(handle)>(handle));
auto __res__ = ::llvm::dyn_cast<CoroSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSaveOp CoroSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value handle) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(handle)>(handle));
}
void CoroSaveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
odsState.addOperands(handle);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroSaveOp CoroSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle));
auto __res__ = ::llvm::dyn_cast<CoroSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSaveOp CoroSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value handle) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(handle)>(handle));
}
void CoroSaveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroSaveOp CoroSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSaveOp CoroSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroSaveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroSaveOp CoroSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSaveOp CoroSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroSaveOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroSaveOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroSaveOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand handleRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> handleOperands(&handleRawOperand, 1); ::llvm::SMLoc handleOperandsLoc;
(void)handleOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
handleOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(handleRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(handleOperands, allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroSaveOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getHandle();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroSaveOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroSizeOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroSizeOpGenericAdaptorBase::CoroSizeOpGenericAdaptorBase(CoroSizeOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroSizeOpAdaptor::CoroSizeOpAdaptor(CoroSizeOp op) : CoroSizeOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroSizeOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroSizeOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroSizeOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroSizeOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroSizeOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroSizeOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroSizeOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroSizeOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res) {
odsState.addTypes(res);
}
CoroSizeOp CoroSizeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res));
auto __res__ = ::llvm::dyn_cast<CoroSizeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSizeOp CoroSizeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res));
}
void CoroSizeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroSizeOp CoroSizeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes));
auto __res__ = ::llvm::dyn_cast<CoroSizeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSizeOp CoroSizeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes));
}
void CoroSizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroSizeOp CoroSizeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroSizeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSizeOp CoroSizeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroSizeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroSizeOp CoroSizeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroSizeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSizeOp CoroSizeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroSizeOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroSizeOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroSizeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
result.addTypes(resTypes);
return ::mlir::success();
}
void CoroSizeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroSizeOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoroSuspendOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoroSuspendOpGenericAdaptorBase::CoroSuspendOpGenericAdaptorBase(CoroSuspendOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CoroSuspendOpAdaptor::CoroSuspendOpAdaptor(CoroSuspendOp op) : CoroSuspendOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoroSuspendOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CoroSuspendOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CoroSuspendOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoroSuspendOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CoroSuspendOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CoroSuspendOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CoroSuspendOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CoroSuspendOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CoroSuspendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value save, ::mlir::Value final) {
odsState.addOperands(save);
odsState.addOperands(final);
odsState.addTypes(res);
}
CoroSuspendOp CoroSuspendOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value save, ::mlir::Value final) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(save)>(save), std::forward<decltype(final)>(final));
auto __res__ = ::llvm::dyn_cast<CoroSuspendOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSuspendOp CoroSuspendOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value save, ::mlir::Value final) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(save)>(save), std::forward<decltype(final)>(final));
}
void CoroSuspendOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value save, ::mlir::Value final) {
odsState.addOperands(save);
odsState.addOperands(final);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoroSuspendOp CoroSuspendOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value save, ::mlir::Value final) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(save)>(save), std::forward<decltype(final)>(final));
auto __res__ = ::llvm::dyn_cast<CoroSuspendOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSuspendOp CoroSuspendOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value save, ::mlir::Value final) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(save)>(save), std::forward<decltype(final)>(final));
}
void CoroSuspendOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroSuspendOp CoroSuspendOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoroSuspendOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSuspendOp CoroSuspendOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoroSuspendOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoroSuspendOp CoroSuspendOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoroSuspendOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoroSuspendOp CoroSuspendOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CoroSuspendOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps9(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps7(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoroSuspendOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult CoroSuspendOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand saveRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> saveOperands(&saveRawOperand, 1); ::llvm::SMLoc saveOperandsLoc;
(void)saveOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand finalRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> finalOperands(&finalRawOperand, 1); ::llvm::SMLoc finalOperandsLoc;
(void)finalOperandsLoc;
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
saveOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(saveRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
finalOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(finalRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<::mlir::TokenType>();
::mlir::Type odsBuildableType1 = parser.getBuilder().getIntegerType(1);
result.addTypes(resTypes);
if (parser.resolveOperands(saveOperands, odsBuildableType0, saveOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(finalOperands, odsBuildableType1, finalOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoroSuspendOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getSave();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getFinal();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoroSuspendOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CosOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CosOpGenericAdaptorBase::CosOpGenericAdaptorBase(CosOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr CosOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags CosOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
CosOpAdaptor::CosOpAdaptor(CosOp op) : CosOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CosOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.cos' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult CosOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute CosOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CosOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> CosOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void CosOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void CosOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult CosOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult CosOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void CosOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags CosOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void CosOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CosOp CosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CosOp CosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CosOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult CosOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CosOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult CosOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult CosOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CosOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void CosOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CosOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::CosOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CoshOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CoshOpGenericAdaptorBase::CoshOpGenericAdaptorBase(CoshOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr CoshOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags CoshOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
CoshOpAdaptor::CoshOpAdaptor(CoshOp op) : CoshOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CoshOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.cosh' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult CoshOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute CoshOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CoshOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> CoshOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void CoshOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void CoshOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult CoshOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult CoshOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void CoshOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags CoshOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void CoshOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CoshOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CoshOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void CoshOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CoshOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CoshOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CoshOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CoshOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CoshOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CoshOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CoshOp CoshOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CoshOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CoshOp CoshOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CoshOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult CoshOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CoshOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult CoshOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult CoshOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CoshOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void CoshOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CoshOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::CoshOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CountLeadingZerosOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CountLeadingZerosOpGenericAdaptorBase::CountLeadingZerosOpGenericAdaptorBase(CountLeadingZerosOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool CountLeadingZerosOpGenericAdaptorBase::getIsZeroPoison() {
auto attr = getIsZeroPoisonAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
CountLeadingZerosOpAdaptor::CountLeadingZerosOpAdaptor(CountLeadingZerosOp op) : CountLeadingZerosOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CountLeadingZerosOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_is_zero_poison = getProperties().is_zero_poison; (void)tblgen_is_zero_poison;
if (!tblgen_is_zero_poison) return emitError(loc, "'llvm.intr.ctlz' op requires attribute 'is_zero_poison'");
if (tblgen_is_zero_poison && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_is_zero_poison))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_is_zero_poison).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.ctlz' op attribute 'is_zero_poison' failed to satisfy constraint: 1-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult CountLeadingZerosOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.is_zero_poison;
auto attr = dict.get("is_zero_poison");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `is_zero_poison` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute CountLeadingZerosOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.is_zero_poison;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("is_zero_poison",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CountLeadingZerosOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.is_zero_poison.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> CountLeadingZerosOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "is_zero_poison")
return prop.is_zero_poison;
return std::nullopt;
}
void CountLeadingZerosOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "is_zero_poison") {
prop.is_zero_poison = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.is_zero_poison)>>(value);
return;
}
}
void CountLeadingZerosOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.is_zero_poison) attrs.append("is_zero_poison", prop.is_zero_poison);
}
::llvm::LogicalResult CountLeadingZerosOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getIsZeroPoisonAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "is_zero_poison", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult CountLeadingZerosOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.is_zero_poison)))
return ::mlir::failure();
return ::mlir::success();
}
void CountLeadingZerosOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.is_zero_poison);
}
bool CountLeadingZerosOp::getIsZeroPoison() {
auto attr = getIsZeroPoisonAttr();
return attr.getValue().getZExtValue();
}
void CountLeadingZerosOp::setIsZeroPoison(bool attrValue) {
getProperties().is_zero_poison = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = is_zero_poison;
odsState.addTypes(res);
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = is_zero_poison;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountLeadingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = is_zero_poison;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, bool is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_zero_poison);
odsState.addTypes(res);
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, bool is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, bool is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, bool is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_zero_poison);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountLeadingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, bool is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, bool is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_zero_poison);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CountLeadingZerosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CountLeadingZerosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountLeadingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CountLeadingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountLeadingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CountLeadingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountLeadingZerosOp CountLeadingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CountLeadingZerosOp::verifyInvariantsImpl() {
auto tblgen_is_zero_poison = getProperties().is_zero_poison; (void)tblgen_is_zero_poison;
if (!tblgen_is_zero_poison) return emitOpError("requires attribute 'is_zero_poison'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_is_zero_poison, "is_zero_poison")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CountLeadingZerosOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult CountLeadingZerosOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::llvm::LogicalResult CountLeadingZerosOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.is_zero_poison;
auto is_zero_poisonAttrName = ::mlir::StringAttr::get(ctx, "is_zero_poison");
auto attr = dict.get(is_zero_poisonAttrName);
usedKeys.insert(is_zero_poisonAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for is_zero_poison in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `is_zero_poison` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void CountLeadingZerosOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CountLeadingZerosOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::CountLeadingZerosOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CountTrailingZerosOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CountTrailingZerosOpGenericAdaptorBase::CountTrailingZerosOpGenericAdaptorBase(CountTrailingZerosOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool CountTrailingZerosOpGenericAdaptorBase::getIsZeroPoison() {
auto attr = getIsZeroPoisonAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
CountTrailingZerosOpAdaptor::CountTrailingZerosOpAdaptor(CountTrailingZerosOp op) : CountTrailingZerosOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CountTrailingZerosOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_is_zero_poison = getProperties().is_zero_poison; (void)tblgen_is_zero_poison;
if (!tblgen_is_zero_poison) return emitError(loc, "'llvm.intr.cttz' op requires attribute 'is_zero_poison'");
if (tblgen_is_zero_poison && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_is_zero_poison))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_is_zero_poison).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.cttz' op attribute 'is_zero_poison' failed to satisfy constraint: 1-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult CountTrailingZerosOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.is_zero_poison;
auto attr = dict.get("is_zero_poison");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `is_zero_poison` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute CountTrailingZerosOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.is_zero_poison;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("is_zero_poison",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CountTrailingZerosOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.is_zero_poison.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> CountTrailingZerosOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "is_zero_poison")
return prop.is_zero_poison;
return std::nullopt;
}
void CountTrailingZerosOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "is_zero_poison") {
prop.is_zero_poison = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.is_zero_poison)>>(value);
return;
}
}
void CountTrailingZerosOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.is_zero_poison) attrs.append("is_zero_poison", prop.is_zero_poison);
}
::llvm::LogicalResult CountTrailingZerosOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getIsZeroPoisonAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "is_zero_poison", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult CountTrailingZerosOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.is_zero_poison)))
return ::mlir::failure();
return ::mlir::success();
}
void CountTrailingZerosOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.is_zero_poison);
}
bool CountTrailingZerosOp::getIsZeroPoison() {
auto attr = getIsZeroPoisonAttr();
return attr.getValue().getZExtValue();
}
void CountTrailingZerosOp::setIsZeroPoison(bool attrValue) {
getProperties().is_zero_poison = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = is_zero_poison;
odsState.addTypes(res);
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = is_zero_poison;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountTrailingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = is_zero_poison;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, bool is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_zero_poison);
odsState.addTypes(res);
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, bool is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, bool is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, bool is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_zero_poison);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountTrailingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, bool is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, bool is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_zero_poison) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().is_zero_poison = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), is_zero_poison);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_zero_poison) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, bool is_zero_poison) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(is_zero_poison)>(is_zero_poison));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CountTrailingZerosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<CountTrailingZerosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountTrailingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CountTrailingZerosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CountTrailingZerosOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CountTrailingZerosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CountTrailingZerosOp CountTrailingZerosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CountTrailingZerosOp::verifyInvariantsImpl() {
auto tblgen_is_zero_poison = getProperties().is_zero_poison; (void)tblgen_is_zero_poison;
if (!tblgen_is_zero_poison) return emitOpError("requires attribute 'is_zero_poison'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_is_zero_poison, "is_zero_poison")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CountTrailingZerosOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult CountTrailingZerosOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::llvm::LogicalResult CountTrailingZerosOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.is_zero_poison;
auto is_zero_poisonAttrName = ::mlir::StringAttr::get(ctx, "is_zero_poison");
auto attr = dict.get(is_zero_poisonAttrName);
usedKeys.insert(is_zero_poisonAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for is_zero_poison in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `is_zero_poison` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void CountTrailingZerosOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CountTrailingZerosOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::CountTrailingZerosOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::CtPopOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
CtPopOpGenericAdaptorBase::CtPopOpGenericAdaptorBase(CtPopOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
CtPopOpAdaptor::CtPopOpAdaptor(CtPopOp op) : CtPopOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult CtPopOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult CtPopOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute CtPopOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code CtPopOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> CtPopOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void CtPopOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void CtPopOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult CtPopOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void CtPopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
CtPopOp CtPopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<CtPopOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CtPopOp CtPopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void CtPopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in) {
odsState.addOperands(in);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CtPopOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
CtPopOp CtPopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<CtPopOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CtPopOp CtPopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in));
}
void CtPopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
CtPopOp CtPopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<CtPopOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CtPopOp CtPopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void CtPopOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CtPopOp CtPopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CtPopOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CtPopOp CtPopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CtPopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CtPopOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CtPopOp CtPopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<CtPopOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CtPopOp CtPopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void CtPopOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
CtPopOp CtPopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CtPopOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CtPopOp CtPopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void CtPopOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(CtPopOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
CtPopOp CtPopOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<CtPopOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
CtPopOp CtPopOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult CtPopOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult CtPopOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult CtPopOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult CtPopOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void CtPopOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void CtPopOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::CtPopOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::DbgDeclareOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
DbgDeclareOpGenericAdaptorBase::DbgDeclareOpGenericAdaptorBase(DbgDeclareOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::DILocalVariableAttr DbgDeclareOpGenericAdaptorBase::getVarInfo() {
auto attr = getVarInfoAttr();
return ::llvm::cast<::mlir::LLVM::DILocalVariableAttr>(attr);
}
::mlir::LLVM::DIExpressionAttr DbgDeclareOpGenericAdaptorBase::getLocationExprAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::DIExpressionAttr>(getProperties().locationExpr);
return attr;
}
::mlir::LLVM::DIExpressionAttr DbgDeclareOpGenericAdaptorBase::getLocationExpr() {
auto attr = getLocationExprAttr();
return ::llvm::cast<::mlir::LLVM::DIExpressionAttr>(attr);
}
} // namespace detail
DbgDeclareOpAdaptor::DbgDeclareOpAdaptor(DbgDeclareOp op) : DbgDeclareOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult DbgDeclareOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_locationExpr = getProperties().locationExpr; (void)tblgen_locationExpr;
auto tblgen_varInfo = getProperties().varInfo; (void)tblgen_varInfo;
if (!tblgen_varInfo) return emitError(loc, "'llvm.intr.dbg.declare' op requires attribute 'varInfo'");
if (tblgen_varInfo && !((::llvm::isa<::mlir::LLVM::DILocalVariableAttr>(tblgen_varInfo))))
return emitError(loc, "'llvm.intr.dbg.declare' op attribute 'varInfo' failed to satisfy constraint: ");
if (tblgen_locationExpr && !((::llvm::isa<::mlir::LLVM::DIExpressionAttr>(tblgen_locationExpr))))
return emitError(loc, "'llvm.intr.dbg.declare' op attribute 'locationExpr' failed to satisfy constraint: ");
return ::mlir::success();
}
::llvm::LogicalResult DbgDeclareOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.locationExpr;
auto attr = dict.get("locationExpr");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `locationExpr` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.varInfo;
auto attr = dict.get("varInfo");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `varInfo` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute DbgDeclareOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.locationExpr;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("locationExpr",
propStorage));
}
{
const auto &propStorage = prop.varInfo;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("varInfo",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code DbgDeclareOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.locationExpr.getAsOpaquePointer()),
llvm::hash_value(prop.varInfo.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> DbgDeclareOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "locationExpr")
return prop.locationExpr;
if (name == "varInfo")
return prop.varInfo;
return std::nullopt;
}
void DbgDeclareOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "locationExpr") {
prop.locationExpr = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.locationExpr)>>(value);
return;
}
if (name == "varInfo") {
prop.varInfo = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.varInfo)>>(value);
return;
}
}
void DbgDeclareOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.locationExpr) attrs.append("locationExpr", prop.locationExpr);
if (prop.varInfo) attrs.append("varInfo", prop.varInfo);
}
::llvm::LogicalResult DbgDeclareOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getLocationExprAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps8(attr, "locationExpr", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getVarInfoAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps7(attr, "varInfo", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult DbgDeclareOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.locationExpr)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.varInfo)))
return ::mlir::failure();
return ::mlir::success();
}
void DbgDeclareOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.locationExpr);
writer.writeAttribute(prop.varInfo);
}
::mlir::LLVM::DILocalVariableAttr DbgDeclareOp::getVarInfo() {
auto attr = getVarInfoAttr();
return ::llvm::cast<::mlir::LLVM::DILocalVariableAttr>(attr);
}
::mlir::LLVM::DIExpressionAttr DbgDeclareOp::getLocationExpr() {
auto attr = getLocationExprAttr();
return ::llvm::cast<::mlir::LLVM::DIExpressionAttr>(attr);
}
void DbgDeclareOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value addr, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
odsState.addOperands(addr);
odsState.getOrAddProperties<Properties>().varInfo = varInfo;
if (locationExpr) {
odsState.getOrAddProperties<Properties>().locationExpr = locationExpr;
}
}
DbgDeclareOp DbgDeclareOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value addr, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(addr)>(addr), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
auto __res__ = ::llvm::dyn_cast<DbgDeclareOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgDeclareOp DbgDeclareOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value addr, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
return create(builder, builder.getLoc(), std::forward<decltype(addr)>(addr), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
}
void DbgDeclareOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
odsState.addOperands(addr);
odsState.getOrAddProperties<Properties>().varInfo = varInfo;
if (locationExpr) {
odsState.getOrAddProperties<Properties>().locationExpr = locationExpr;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
DbgDeclareOp DbgDeclareOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
auto __res__ = ::llvm::dyn_cast<DbgDeclareOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgDeclareOp DbgDeclareOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
}
void DbgDeclareOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<DbgDeclareOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
DbgDeclareOp DbgDeclareOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<DbgDeclareOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgDeclareOp DbgDeclareOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void DbgDeclareOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
DbgDeclareOp DbgDeclareOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<DbgDeclareOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgDeclareOp DbgDeclareOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void DbgDeclareOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.locationExpr)
properties.locationExpr = ::mlir::LLVM::DIExpressionAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult DbgDeclareOp::verifyInvariantsImpl() {
auto tblgen_locationExpr = getProperties().locationExpr; (void)tblgen_locationExpr;
auto tblgen_varInfo = getProperties().varInfo; (void)tblgen_varInfo;
if (!tblgen_varInfo) return emitOpError("requires attribute 'varInfo'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps7(*this, tblgen_varInfo, "varInfo")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps8(*this, tblgen_locationExpr, "locationExpr")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult DbgDeclareOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult DbgDeclareOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::LLVM::DILocalVariableAttr varInfoAttr;
::mlir::LLVM::DIExpressionAttr locationExprAttr;
::mlir::OpAsmParser::UnresolvedOperand addrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> addrOperands(&addrRawOperand, 1); ::llvm::SMLoc addrOperandsLoc;
(void)addrOperandsLoc;
::mlir::Type addrRawType{};
::llvm::ArrayRef<::mlir::Type> addrTypes(&addrRawType, 1);
if (parser.parseAttribute(varInfoAttr, ::mlir::Type{}))
return ::mlir::failure();
if (varInfoAttr) result.getOrAddProperties<DbgDeclareOp::Properties>().varInfo = varInfoAttr;
::mlir::OptionalParseResult parseResultlocationExprAttr =
parser.parseOptionalAttribute(locationExprAttr, ::mlir::Type{});
if (parseResultlocationExprAttr.has_value() && failed(*parseResultlocationExprAttr))
return ::mlir::failure();
if (parseResultlocationExprAttr.has_value() && succeeded(*parseResultlocationExprAttr))
if (locationExprAttr) result.getOrAddProperties<DbgDeclareOp::Properties>().locationExpr = locationExprAttr;
if (locationExprAttr) {
}
if (parser.parseEqual())
return ::mlir::failure();
addrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(addrRawOperand))
return ::mlir::failure();
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(addrRawType))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.resolveOperands(addrOperands, addrTypes, addrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void DbgDeclareOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter.printAttribute(getVarInfoAttr());
if (getLocationExprAttr() != ::mlir::LLVM::DIExpressionAttr::get(::mlir::OpBuilder((*this)->getContext()).getContext(), {})) {
_odsPrinter << ' ';
_odsPrinter.printAttribute(getLocationExprAttr());
}
_odsPrinter << ' ' << "=";
_odsPrinter << ' ';
_odsPrinter << getAddr();
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getAddr().getType();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("varInfo");
elidedAttrs.push_back("locationExpr");
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getLocationExprAttr();
if(attr && (attr == ::mlir::LLVM::DIExpressionAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("locationExpr");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::DbgDeclareOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::DbgDeclareOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::DbgLabelOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
DbgLabelOpGenericAdaptorBase::DbgLabelOpGenericAdaptorBase(DbgLabelOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::DILabelAttr DbgLabelOpGenericAdaptorBase::getLabel() {
auto attr = getLabelAttr();
return ::llvm::cast<::mlir::LLVM::DILabelAttr>(attr);
}
} // namespace detail
DbgLabelOpAdaptor::DbgLabelOpAdaptor(DbgLabelOp op) : DbgLabelOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult DbgLabelOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_label = getProperties().label; (void)tblgen_label;
if (!tblgen_label) return emitError(loc, "'llvm.intr.dbg.label' op requires attribute 'label'");
if (tblgen_label && !((::llvm::isa<::mlir::LLVM::DILabelAttr>(tblgen_label))))
return emitError(loc, "'llvm.intr.dbg.label' op attribute 'label' failed to satisfy constraint: ");
return ::mlir::success();
}
::llvm::LogicalResult DbgLabelOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.label;
auto attr = dict.get("label");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `label` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute DbgLabelOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.label;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("label",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code DbgLabelOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.label.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> DbgLabelOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "label")
return prop.label;
return std::nullopt;
}
void DbgLabelOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "label") {
prop.label = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.label)>>(value);
return;
}
}
void DbgLabelOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.label) attrs.append("label", prop.label);
}
::llvm::LogicalResult DbgLabelOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getLabelAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps9(attr, "label", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult DbgLabelOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.label)))
return ::mlir::failure();
return ::mlir::success();
}
void DbgLabelOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.label);
}
::mlir::LLVM::DILabelAttr DbgLabelOp::getLabel() {
auto attr = getLabelAttr();
return ::llvm::cast<::mlir::LLVM::DILabelAttr>(attr);
}
void DbgLabelOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::LLVM::DILabelAttr label) {
odsState.getOrAddProperties<Properties>().label = label;
}
DbgLabelOp DbgLabelOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::LLVM::DILabelAttr label) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(label)>(label));
auto __res__ = ::llvm::dyn_cast<DbgLabelOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgLabelOp DbgLabelOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::LLVM::DILabelAttr label) {
return create(builder, builder.getLoc(), std::forward<decltype(label)>(label));
}
void DbgLabelOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::LLVM::DILabelAttr label) {
odsState.getOrAddProperties<Properties>().label = label;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
DbgLabelOp DbgLabelOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::LLVM::DILabelAttr label) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(label)>(label));
auto __res__ = ::llvm::dyn_cast<DbgLabelOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgLabelOp DbgLabelOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::LLVM::DILabelAttr label) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(label)>(label));
}
void DbgLabelOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<DbgLabelOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
DbgLabelOp DbgLabelOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<DbgLabelOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgLabelOp DbgLabelOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void DbgLabelOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
DbgLabelOp DbgLabelOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<DbgLabelOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgLabelOp DbgLabelOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult DbgLabelOp::verifyInvariantsImpl() {
auto tblgen_label = getProperties().label; (void)tblgen_label;
if (!tblgen_label) return emitOpError("requires attribute 'label'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps9(*this, tblgen_label, "label")))
return ::mlir::failure();
return ::mlir::success();
}
::llvm::LogicalResult DbgLabelOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult DbgLabelOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::LLVM::DILabelAttr labelAttr;
if (parser.parseCustomAttributeWithFallback(labelAttr, ::mlir::Type{})) {
return ::mlir::failure();
}
if (labelAttr) result.getOrAddProperties<DbgLabelOp::Properties>().label = labelAttr;
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
return ::mlir::success();
}
void DbgLabelOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter.printStrippedAttrOrType(getLabelAttr());
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("label");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::DbgLabelOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::DbgLabelOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::DbgValueOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
DbgValueOpGenericAdaptorBase::DbgValueOpGenericAdaptorBase(DbgValueOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::DILocalVariableAttr DbgValueOpGenericAdaptorBase::getVarInfo() {
auto attr = getVarInfoAttr();
return ::llvm::cast<::mlir::LLVM::DILocalVariableAttr>(attr);
}
::mlir::LLVM::DIExpressionAttr DbgValueOpGenericAdaptorBase::getLocationExprAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::DIExpressionAttr>(getProperties().locationExpr);
return attr;
}
::mlir::LLVM::DIExpressionAttr DbgValueOpGenericAdaptorBase::getLocationExpr() {
auto attr = getLocationExprAttr();
return ::llvm::cast<::mlir::LLVM::DIExpressionAttr>(attr);
}
} // namespace detail
DbgValueOpAdaptor::DbgValueOpAdaptor(DbgValueOp op) : DbgValueOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult DbgValueOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_locationExpr = getProperties().locationExpr; (void)tblgen_locationExpr;
auto tblgen_varInfo = getProperties().varInfo; (void)tblgen_varInfo;
if (!tblgen_varInfo) return emitError(loc, "'llvm.intr.dbg.value' op requires attribute 'varInfo'");
if (tblgen_varInfo && !((::llvm::isa<::mlir::LLVM::DILocalVariableAttr>(tblgen_varInfo))))
return emitError(loc, "'llvm.intr.dbg.value' op attribute 'varInfo' failed to satisfy constraint: ");
if (tblgen_locationExpr && !((::llvm::isa<::mlir::LLVM::DIExpressionAttr>(tblgen_locationExpr))))
return emitError(loc, "'llvm.intr.dbg.value' op attribute 'locationExpr' failed to satisfy constraint: ");
return ::mlir::success();
}
::llvm::LogicalResult DbgValueOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.locationExpr;
auto attr = dict.get("locationExpr");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `locationExpr` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.varInfo;
auto attr = dict.get("varInfo");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `varInfo` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute DbgValueOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.locationExpr;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("locationExpr",
propStorage));
}
{
const auto &propStorage = prop.varInfo;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("varInfo",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code DbgValueOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.locationExpr.getAsOpaquePointer()),
llvm::hash_value(prop.varInfo.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> DbgValueOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "locationExpr")
return prop.locationExpr;
if (name == "varInfo")
return prop.varInfo;
return std::nullopt;
}
void DbgValueOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "locationExpr") {
prop.locationExpr = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.locationExpr)>>(value);
return;
}
if (name == "varInfo") {
prop.varInfo = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.varInfo)>>(value);
return;
}
}
void DbgValueOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.locationExpr) attrs.append("locationExpr", prop.locationExpr);
if (prop.varInfo) attrs.append("varInfo", prop.varInfo);
}
::llvm::LogicalResult DbgValueOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getLocationExprAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps8(attr, "locationExpr", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getVarInfoAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps7(attr, "varInfo", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult DbgValueOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.locationExpr)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.varInfo)))
return ::mlir::failure();
return ::mlir::success();
}
void DbgValueOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.locationExpr);
writer.writeAttribute(prop.varInfo);
}
::mlir::LLVM::DILocalVariableAttr DbgValueOp::getVarInfo() {
auto attr = getVarInfoAttr();
return ::llvm::cast<::mlir::LLVM::DILocalVariableAttr>(attr);
}
::mlir::LLVM::DIExpressionAttr DbgValueOp::getLocationExpr() {
auto attr = getLocationExprAttr();
return ::llvm::cast<::mlir::LLVM::DIExpressionAttr>(attr);
}
void DbgValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
odsState.addOperands(value);
odsState.getOrAddProperties<Properties>().varInfo = varInfo;
if (locationExpr) {
odsState.getOrAddProperties<Properties>().locationExpr = locationExpr;
}
}
DbgValueOp DbgValueOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
auto __res__ = ::llvm::dyn_cast<DbgValueOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgValueOp DbgValueOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
}
void DbgValueOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
odsState.addOperands(value);
odsState.getOrAddProperties<Properties>().varInfo = varInfo;
if (locationExpr) {
odsState.getOrAddProperties<Properties>().locationExpr = locationExpr;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
DbgValueOp DbgValueOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
auto __res__ = ::llvm::dyn_cast<DbgValueOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgValueOp DbgValueOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::LLVM::DILocalVariableAttr varInfo, ::mlir::LLVM::DIExpressionAttr locationExpr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(varInfo)>(varInfo), std::forward<decltype(locationExpr)>(locationExpr));
}
void DbgValueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<DbgValueOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
DbgValueOp DbgValueOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<DbgValueOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgValueOp DbgValueOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void DbgValueOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
DbgValueOp DbgValueOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<DbgValueOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DbgValueOp DbgValueOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void DbgValueOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.locationExpr)
properties.locationExpr = ::mlir::LLVM::DIExpressionAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult DbgValueOp::verifyInvariantsImpl() {
auto tblgen_locationExpr = getProperties().locationExpr; (void)tblgen_locationExpr;
auto tblgen_varInfo = getProperties().varInfo; (void)tblgen_varInfo;
if (!tblgen_varInfo) return emitOpError("requires attribute 'varInfo'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps7(*this, tblgen_varInfo, "varInfo")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps8(*this, tblgen_locationExpr, "locationExpr")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult DbgValueOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult DbgValueOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::LLVM::DILocalVariableAttr varInfoAttr;
::mlir::LLVM::DIExpressionAttr locationExprAttr;
::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
(void)valueOperandsLoc;
::mlir::Type valueRawType{};
::llvm::ArrayRef<::mlir::Type> valueTypes(&valueRawType, 1);
if (parser.parseAttribute(varInfoAttr, ::mlir::Type{}))
return ::mlir::failure();
if (varInfoAttr) result.getOrAddProperties<DbgValueOp::Properties>().varInfo = varInfoAttr;
::mlir::OptionalParseResult parseResultlocationExprAttr =
parser.parseOptionalAttribute(locationExprAttr, ::mlir::Type{});
if (parseResultlocationExprAttr.has_value() && failed(*parseResultlocationExprAttr))
return ::mlir::failure();
if (parseResultlocationExprAttr.has_value() && succeeded(*parseResultlocationExprAttr))
if (locationExprAttr) result.getOrAddProperties<DbgValueOp::Properties>().locationExpr = locationExprAttr;
if (locationExprAttr) {
}
if (parser.parseEqual())
return ::mlir::failure();
valueOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(valueRawOperand))
return ::mlir::failure();
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(valueRawType))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.resolveOperands(valueOperands, valueTypes, valueOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void DbgValueOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter.printAttribute(getVarInfoAttr());
if (getLocationExprAttr() != ::mlir::LLVM::DIExpressionAttr::get(::mlir::OpBuilder((*this)->getContext()).getContext(), {})) {
_odsPrinter << ' ';
_odsPrinter.printAttribute(getLocationExprAttr());
}
_odsPrinter << ' ' << "=";
_odsPrinter << ' ';
_odsPrinter << getValue();
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getValue().getType();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("varInfo");
elidedAttrs.push_back("locationExpr");
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getLocationExprAttr();
if(attr && (attr == ::mlir::LLVM::DIExpressionAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("locationExpr");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::DbgValueOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::DbgValueOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::DebugTrap definitions
//===----------------------------------------------------------------------===//
namespace detail {
DebugTrapGenericAdaptorBase::DebugTrapGenericAdaptorBase(DebugTrap op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
DebugTrapAdaptor::DebugTrapAdaptor(DebugTrap op) : DebugTrapGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult DebugTrapAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult DebugTrap::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute DebugTrap::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code DebugTrap::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> DebugTrap::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void DebugTrap::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void DebugTrap::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult DebugTrap::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void DebugTrap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
}
DebugTrap DebugTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__);
auto __res__ = ::llvm::dyn_cast<DebugTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DebugTrap DebugTrap::create(::mlir::ImplicitLocOpBuilder &builder) {
return create(builder, builder.getLoc());
}
void DebugTrap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
DebugTrap DebugTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes));
auto __res__ = ::llvm::dyn_cast<DebugTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DebugTrap DebugTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes));
}
void DebugTrap::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
DebugTrap DebugTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<DebugTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DebugTrap DebugTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void DebugTrap::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
DebugTrap DebugTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<DebugTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
DebugTrap DebugTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult DebugTrap::verifyInvariantsImpl() {
return ::mlir::success();
}
::llvm::LogicalResult DebugTrap::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult DebugTrap::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
return ::mlir::success();
}
void DebugTrap::print(::mlir::OpAsmPrinter &_odsPrinter) {
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::DebugTrap)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::EhTypeidForOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
EhTypeidForOpGenericAdaptorBase::EhTypeidForOpGenericAdaptorBase(EhTypeidForOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
EhTypeidForOpAdaptor::EhTypeidForOpAdaptor(EhTypeidForOp op) : EhTypeidForOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult EhTypeidForOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult EhTypeidForOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute EhTypeidForOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code EhTypeidForOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> EhTypeidForOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void EhTypeidForOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void EhTypeidForOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult EhTypeidForOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void EhTypeidForOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value type_info) {
odsState.addOperands(type_info);
odsState.addTypes(res);
}
EhTypeidForOp EhTypeidForOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value type_info) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(type_info)>(type_info));
auto __res__ = ::llvm::dyn_cast<EhTypeidForOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EhTypeidForOp EhTypeidForOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value type_info) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(type_info)>(type_info));
}
void EhTypeidForOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value type_info) {
odsState.addOperands(type_info);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
EhTypeidForOp EhTypeidForOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value type_info) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(type_info)>(type_info));
auto __res__ = ::llvm::dyn_cast<EhTypeidForOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EhTypeidForOp EhTypeidForOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value type_info) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(type_info)>(type_info));
}
void EhTypeidForOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
EhTypeidForOp EhTypeidForOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<EhTypeidForOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EhTypeidForOp EhTypeidForOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void EhTypeidForOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
EhTypeidForOp EhTypeidForOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<EhTypeidForOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
EhTypeidForOp EhTypeidForOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult EhTypeidForOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult EhTypeidForOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult EhTypeidForOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand type_infoRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> type_infoOperands(&type_infoRawOperand, 1); ::llvm::SMLoc type_infoOperandsLoc;
(void)type_infoOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
type_infoOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(type_infoRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(type_infoOperands, allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void EhTypeidForOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getTypeInfo();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::EhTypeidForOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::Exp10Op definitions
//===----------------------------------------------------------------------===//
namespace detail {
Exp10OpGenericAdaptorBase::Exp10OpGenericAdaptorBase(Exp10Op op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr Exp10OpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags Exp10OpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
Exp10OpAdaptor::Exp10OpAdaptor(Exp10Op op) : Exp10OpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult Exp10OpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.exp10' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult Exp10Op::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute Exp10Op::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code Exp10Op::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> Exp10Op::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void Exp10Op::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void Exp10Op::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult Exp10Op::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult Exp10Op::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void Exp10Op::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags Exp10Op::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void Exp10Op::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp10Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Exp10Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Exp10Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Exp10Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Exp10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Exp10Op Exp10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Exp10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp10Op Exp10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Exp10Op::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult Exp10Op::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult Exp10Op::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult Exp10Op::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult Exp10Op::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void Exp10Op::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void Exp10Op::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::Exp10Op)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::Exp10OpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::Exp2Op definitions
//===----------------------------------------------------------------------===//
namespace detail {
Exp2OpGenericAdaptorBase::Exp2OpGenericAdaptorBase(Exp2Op op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr Exp2OpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags Exp2OpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
Exp2OpAdaptor::Exp2OpAdaptor(Exp2Op op) : Exp2OpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult Exp2OpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.exp2' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult Exp2Op::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute Exp2Op::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code Exp2Op::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> Exp2Op::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void Exp2Op::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void Exp2Op::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult Exp2Op::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult Exp2Op::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void Exp2Op::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags Exp2Op::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void Exp2Op::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Exp2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Exp2Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Exp2Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Exp2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Exp2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Exp2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Exp2Op Exp2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Exp2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Exp2Op Exp2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Exp2Op::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult Exp2Op::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult Exp2Op::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult Exp2Op::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult Exp2Op::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void Exp2Op::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void Exp2Op::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::Exp2Op)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::Exp2OpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ExpOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ExpOpGenericAdaptorBase::ExpOpGenericAdaptorBase(ExpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr ExpOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags ExpOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
ExpOpAdaptor::ExpOpAdaptor(ExpOp op) : ExpOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ExpOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.exp' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult ExpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ExpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ExpOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ExpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void ExpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void ExpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult ExpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ExpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void ExpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags ExpOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void ExpOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void ExpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ExpOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ExpOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ExpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ExpOp ExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpOp ExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ExpOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult ExpOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ExpOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ExpOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ExpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ExpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void ExpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ExpOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ExpOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ExpectOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ExpectOpGenericAdaptorBase::ExpectOpGenericAdaptorBase(ExpectOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
ExpectOpAdaptor::ExpectOpAdaptor(ExpectOp op) : ExpectOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ExpectOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult ExpectOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute ExpectOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ExpectOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> ExpectOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void ExpectOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void ExpectOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult ExpectOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void ExpectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected) {
odsState.addOperands(val);
odsState.addOperands(expected);
odsState.addTypes(res);
}
ExpectOp ExpectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected));
auto __res__ = ::llvm::dyn_cast<ExpectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectOp ExpectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected));
}
void ExpectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val, ::mlir::Value expected) {
odsState.addOperands(val);
odsState.addOperands(expected);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpectOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ExpectOp ExpectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val, ::mlir::Value expected) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected));
auto __res__ = ::llvm::dyn_cast<ExpectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectOp ExpectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val, ::mlir::Value expected) {
return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected));
}
void ExpectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected) {
odsState.addOperands(val);
odsState.addOperands(expected);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ExpectOp ExpectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected));
auto __res__ = ::llvm::dyn_cast<ExpectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectOp ExpectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected));
}
void ExpectOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ExpectOp ExpectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ExpectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectOp ExpectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ExpectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpectOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ExpectOp ExpectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ExpectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectOp ExpectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ExpectOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ExpectOp ExpectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ExpectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectOp ExpectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ExpectOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpectOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ExpectOp ExpectOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ExpectOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectOp ExpectOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ExpectOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ExpectOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ExpectOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ExpectOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
(void)valOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand expectedRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> expectedOperands(&expectedRawOperand, 1); ::llvm::SMLoc expectedOperandsLoc;
(void)expectedOperandsLoc;
::mlir::Type valRawType{};
::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
valOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(valRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
expectedOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(expectedRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::IntegerType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
valRawType = type;
}
result.addTypes(valTypes[0]);
if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(expectedOperands, valTypes[0], expectedOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ExpectOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getVal();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getExpected();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getVal().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::IntegerType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ExpectOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ExpectOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ExpectWithProbabilityOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ExpectWithProbabilityOpGenericAdaptorBase::ExpectWithProbabilityOpGenericAdaptorBase(ExpectWithProbabilityOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::llvm::APFloat ExpectWithProbabilityOpGenericAdaptorBase::getProb() {
auto attr = getProbAttr();
return attr.getValue();
}
} // namespace detail
ExpectWithProbabilityOpAdaptor::ExpectWithProbabilityOpAdaptor(ExpectWithProbabilityOp op) : ExpectWithProbabilityOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ExpectWithProbabilityOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_prob = getProperties().prob; (void)tblgen_prob;
if (!tblgen_prob) return emitError(loc, "'llvm.intr.expect.with.probability' op requires attribute 'prob'");
if (tblgen_prob && !(((::llvm::isa<::mlir::FloatAttr>(tblgen_prob))) && ((::llvm::cast<::mlir::FloatAttr>(tblgen_prob).getType().isF64()))))
return emitError(loc, "'llvm.intr.expect.with.probability' op attribute 'prob' failed to satisfy constraint: 64-bit float attribute");
return ::mlir::success();
}
::llvm::LogicalResult ExpectWithProbabilityOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.prob;
auto attr = dict.get("prob");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `prob` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute ExpectWithProbabilityOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.prob;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("prob",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ExpectWithProbabilityOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.prob.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> ExpectWithProbabilityOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "prob")
return prop.prob;
return std::nullopt;
}
void ExpectWithProbabilityOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "prob") {
prop.prob = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.prob)>>(value);
return;
}
}
void ExpectWithProbabilityOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.prob) attrs.append("prob", prop.prob);
}
::llvm::LogicalResult ExpectWithProbabilityOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getProbAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps10(attr, "prob", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult ExpectWithProbabilityOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.prob)))
return ::mlir::failure();
return ::mlir::success();
}
void ExpectWithProbabilityOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.prob);
}
::llvm::APFloat ExpectWithProbabilityOp::getProb() {
auto attr = getProbAttr();
return attr.getValue();
}
void ExpectWithProbabilityOp::setProb(::llvm::APFloat attrValue) {
getProperties().prob = ::mlir::Builder((*this)->getContext()).getFloatAttr(::mlir::Builder((*this)->getContext()).getF64Type(), attrValue);
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
odsState.addOperands(val);
odsState.addOperands(expected);
odsState.getOrAddProperties<Properties>().prob = prob;
odsState.addTypes(res);
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
odsState.addOperands(val);
odsState.addOperands(expected);
odsState.getOrAddProperties<Properties>().prob = prob;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpectWithProbabilityOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
odsState.addOperands(val);
odsState.addOperands(expected);
odsState.getOrAddProperties<Properties>().prob = prob;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected, ::mlir::FloatAttr prob) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
odsState.addOperands(val);
odsState.addOperands(expected);
odsState.getOrAddProperties<Properties>().prob = odsBuilder.getFloatAttr(odsBuilder.getF64Type(), prob);
odsState.addTypes(res);
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
odsState.addOperands(val);
odsState.addOperands(expected);
odsState.getOrAddProperties<Properties>().prob = odsBuilder.getFloatAttr(odsBuilder.getF64Type(), prob);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpectWithProbabilityOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
odsState.addOperands(val);
odsState.addOperands(expected);
odsState.getOrAddProperties<Properties>().prob = odsBuilder.getFloatAttr(odsBuilder.getF64Type(), prob);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value expected, ::llvm::APFloat prob) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(expected)>(expected), std::forward<decltype(prob)>(prob));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ExpectWithProbabilityOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<ExpectWithProbabilityOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpectWithProbabilityOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void ExpectWithProbabilityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(ExpectWithProbabilityOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ExpectWithProbabilityOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ExpectWithProbabilityOp ExpectWithProbabilityOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ExpectWithProbabilityOp::verifyInvariantsImpl() {
auto tblgen_prob = getProperties().prob; (void)tblgen_prob;
if (!tblgen_prob) return emitOpError("requires attribute 'prob'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps10(*this, tblgen_prob, "prob")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSOperands(1).begin()).getType()) && ((*this->getODSOperands(1).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()) && ((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType()))))
return emitOpError("failed to verify that all of {val, expected, res} have same type");
return ::mlir::success();
}
::llvm::LogicalResult ExpectWithProbabilityOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ExpectWithProbabilityOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 1)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[1].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult ExpectWithProbabilityOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand valRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valOperands(&valRawOperand, 1); ::llvm::SMLoc valOperandsLoc;
(void)valOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand expectedRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> expectedOperands(&expectedRawOperand, 1); ::llvm::SMLoc expectedOperandsLoc;
(void)expectedOperandsLoc;
::mlir::FloatAttr probAttr;
::mlir::Type valRawType{};
::llvm::ArrayRef<::mlir::Type> valTypes(&valRawType, 1);
valOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(valRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
expectedOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(expectedRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(probAttr, parser.getBuilder().getF64Type())) {
return ::mlir::failure();
}
if (probAttr) result.getOrAddProperties<ExpectWithProbabilityOp::Properties>().prob = probAttr;
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::IntegerType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
valRawType = type;
}
result.addTypes(valTypes[0]);
if (parser.resolveOperands(valOperands, valTypes, valOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(expectedOperands, valTypes[0], expectedOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void ExpectWithProbabilityOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getVal();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getExpected();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getProbAttr());
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("prob");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getVal().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::IntegerType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void ExpectWithProbabilityOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ExpectWithProbabilityOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::ExpectWithProbabilityOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FAbsOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FAbsOpGenericAdaptorBase::FAbsOpGenericAdaptorBase(FAbsOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr FAbsOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags FAbsOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
FAbsOpAdaptor::FAbsOpAdaptor(FAbsOp op) : FAbsOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FAbsOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.fabs' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult FAbsOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute FAbsOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FAbsOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> FAbsOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void FAbsOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void FAbsOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult FAbsOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult FAbsOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void FAbsOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags FAbsOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void FAbsOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FAbsOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FAbsOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FAbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FAbsOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FAbsOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FAbsOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FAbsOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FAbsOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FAbsOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FAbsOp FAbsOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FAbsOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FAbsOp FAbsOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FAbsOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult FAbsOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FAbsOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FAbsOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FAbsOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FAbsOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FAbsOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FAbsOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::FAbsOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FCeilOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FCeilOpGenericAdaptorBase::FCeilOpGenericAdaptorBase(FCeilOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr FCeilOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags FCeilOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
FCeilOpAdaptor::FCeilOpAdaptor(FCeilOp op) : FCeilOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FCeilOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.ceil' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult FCeilOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute FCeilOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FCeilOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> FCeilOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void FCeilOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void FCeilOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult FCeilOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult FCeilOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void FCeilOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags FCeilOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void FCeilOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FCeilOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FCeilOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FCeilOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FCeilOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FCeilOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FCeilOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FCeilOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FCeilOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FCeilOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FCeilOp FCeilOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FCeilOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FCeilOp FCeilOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FCeilOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult FCeilOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FCeilOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FCeilOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FCeilOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FCeilOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FCeilOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FCeilOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::FCeilOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FFloorOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FFloorOpGenericAdaptorBase::FFloorOpGenericAdaptorBase(FFloorOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr FFloorOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags FFloorOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
FFloorOpAdaptor::FFloorOpAdaptor(FFloorOp op) : FFloorOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FFloorOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.floor' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult FFloorOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute FFloorOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FFloorOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> FFloorOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void FFloorOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void FFloorOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult FFloorOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult FFloorOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void FFloorOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags FFloorOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void FFloorOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FFloorOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FFloorOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FFloorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FFloorOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FFloorOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FFloorOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FFloorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FFloorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FFloorOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FFloorOp FFloorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FFloorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FFloorOp FFloorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FFloorOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult FFloorOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FFloorOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FFloorOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FFloorOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FFloorOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FFloorOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FFloorOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::FFloorOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FMAOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FMAOpGenericAdaptorBase::FMAOpGenericAdaptorBase(FMAOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr FMAOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags FMAOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
FMAOpAdaptor::FMAOpAdaptor(FMAOp op) : FMAOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FMAOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.fma' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult FMAOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute FMAOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FMAOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> FMAOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void FMAOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void FMAOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult FMAOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult FMAOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void FMAOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags FMAOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void FMAOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMAOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMAOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMAOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FMAOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FMAOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMAOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FMAOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FMAOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMAOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FMAOp FMAOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FMAOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMAOp FMAOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FMAOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult FMAOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FMAOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FMAOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FMAOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FMAOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FMAOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FMAOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::FMAOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FMulAddOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FMulAddOpGenericAdaptorBase::FMulAddOpGenericAdaptorBase(FMulAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr FMulAddOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags FMulAddOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
FMulAddOpAdaptor::FMulAddOpAdaptor(FMulAddOp op) : FMulAddOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FMulAddOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.fmuladd' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult FMulAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute FMulAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FMulAddOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> FMulAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void FMulAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void FMulAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult FMulAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult FMulAddOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void FMulAddOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags FMulAddOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void FMulAddOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMulAddOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMulAddOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FMulAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FMulAddOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FMulAddOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMulAddOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FMulAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FMulAddOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FMulAddOp FMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FMulAddOp FMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FMulAddOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult FMulAddOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FMulAddOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FMulAddOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FMulAddOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FMulAddOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FMulAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FMulAddOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::FMulAddOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FTruncOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FTruncOpGenericAdaptorBase::FTruncOpGenericAdaptorBase(FTruncOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr FTruncOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags FTruncOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
FTruncOpAdaptor::FTruncOpAdaptor(FTruncOp op) : FTruncOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FTruncOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.trunc' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult FTruncOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute FTruncOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FTruncOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> FTruncOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void FTruncOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void FTruncOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult FTruncOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult FTruncOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void FTruncOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags FTruncOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void FTruncOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FTruncOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FTruncOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FTruncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FTruncOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FTruncOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FTruncOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FTruncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FTruncOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FTruncOp FTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FTruncOp FTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FTruncOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult FTruncOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FTruncOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FTruncOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FTruncOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FTruncOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FTruncOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FTruncOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::FTruncOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FakeUseOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FakeUseOpGenericAdaptorBase::FakeUseOpGenericAdaptorBase(FakeUseOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> FakeUseOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
bool isVariadic[] = {true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (odsOperandsSize - 0) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
} // namespace detail
FakeUseOpAdaptor::FakeUseOpAdaptor(FakeUseOp op) : FakeUseOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FakeUseOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
std::pair<unsigned, unsigned> FakeUseOp::getODSOperandIndexAndLength(unsigned index) {
bool isVariadic[] = {true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (getOperation()->getNumOperands() - 0) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
::mlir::MutableOperandRange FakeUseOp::getArgsMutable() {
auto range = getODSOperandIndexAndLength(0);
auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
return mutableRange;
}
::llvm::LogicalResult FakeUseOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute FakeUseOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FakeUseOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> FakeUseOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void FakeUseOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void FakeUseOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult FakeUseOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void FakeUseOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange args) {
odsState.addOperands(args);
}
FakeUseOp FakeUseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange args) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(args)>(args));
auto __res__ = ::llvm::dyn_cast<FakeUseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FakeUseOp FakeUseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange args) {
return create(builder, builder.getLoc(), std::forward<decltype(args)>(args));
}
void FakeUseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FakeUseOp FakeUseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FakeUseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FakeUseOp FakeUseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FakeUseOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FakeUseOp FakeUseOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FakeUseOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FakeUseOp FakeUseOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult FakeUseOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps8(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FakeUseOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult FakeUseOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> argsOperands;
::llvm::SMLoc argsOperandsLoc;
(void)argsOperandsLoc;
::llvm::SmallVector<::mlir::Type, 1> argsTypes;
argsOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperandList(argsOperands))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseTypeList(argsTypes))
return ::mlir::failure();
if (parser.resolveOperands(argsOperands, argsTypes, argsOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FakeUseOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArgs();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getArgs().getTypes();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FakeUseOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FractionExpOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FractionExpOpGenericAdaptorBase::FractionExpOpGenericAdaptorBase(FractionExpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr FractionExpOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags FractionExpOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
FractionExpOpAdaptor::FractionExpOpAdaptor(FractionExpOp op) : FractionExpOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FractionExpOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.frexp' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult FractionExpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute FractionExpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FractionExpOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> FractionExpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void FractionExpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void FractionExpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult FractionExpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult FractionExpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void FractionExpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags FractionExpOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void FractionExpOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void FractionExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
FractionExpOp FractionExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FractionExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FractionExpOp FractionExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FractionExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FractionExpOp FractionExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FractionExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FractionExpOp FractionExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FractionExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
FractionExpOp FractionExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FractionExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FractionExpOp FractionExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FractionExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FractionExpOp FractionExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<FractionExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FractionExpOp FractionExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void FractionExpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<FractionExpOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
FractionExpOp FractionExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FractionExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FractionExpOp FractionExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FractionExpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FractionExpOp FractionExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FractionExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FractionExpOp FractionExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FractionExpOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult FractionExpOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FractionExpOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult FractionExpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FractionExpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FractionExpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FractionExpOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::FractionExpOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FshlOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FshlOpGenericAdaptorBase::FshlOpGenericAdaptorBase(FshlOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
FshlOpAdaptor::FshlOpAdaptor(FshlOp op) : FshlOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FshlOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult FshlOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute FshlOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FshlOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> FshlOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void FshlOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void FshlOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult FshlOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void FshlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.addTypes(res);
}
FshlOp FshlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
auto __res__ = ::llvm::dyn_cast<FshlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshlOp FshlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
}
void FshlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FshlOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FshlOp FshlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
auto __res__ = ::llvm::dyn_cast<FshlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshlOp FshlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
}
void FshlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FshlOp FshlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
auto __res__ = ::llvm::dyn_cast<FshlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshlOp FshlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
}
void FshlOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FshlOp FshlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FshlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshlOp FshlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FshlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FshlOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FshlOp FshlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FshlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshlOp FshlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FshlOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FshlOp FshlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FshlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshlOp FshlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FshlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FshlOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FshlOp FshlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FshlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshlOp FshlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult FshlOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FshlOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FshlOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FshlOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FshlOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FshlOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FshlOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::FshrOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
FshrOpGenericAdaptorBase::FshrOpGenericAdaptorBase(FshrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
FshrOpAdaptor::FshrOpAdaptor(FshrOp op) : FshrOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult FshrOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult FshrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute FshrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code FshrOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> FshrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void FshrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void FshrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult FshrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void FshrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
odsState.addTypes(res);
}
FshrOp FshrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
auto __res__ = ::llvm::dyn_cast<FshrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshrOp FshrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
}
void FshrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FshrOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
FshrOp FshrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
auto __res__ = ::llvm::dyn_cast<FshrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshrOp FshrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
}
void FshrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addOperands(c);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
FshrOp FshrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
auto __res__ = ::llvm::dyn_cast<FshrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshrOp FshrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::Value c) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(c)>(c));
}
void FshrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FshrOp FshrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FshrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshrOp FshrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FshrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FshrOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FshrOp FshrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<FshrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshrOp FshrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void FshrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
FshrOp FshrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FshrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshrOp FshrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void FshrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(FshrOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
FshrOp FshrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<FshrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
FshrOp FshrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult FshrOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult FshrOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult FshrOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult FshrOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void FshrOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void FshrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::FshrOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::GetActiveLaneMaskOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
GetActiveLaneMaskOpGenericAdaptorBase::GetActiveLaneMaskOpGenericAdaptorBase(GetActiveLaneMaskOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
GetActiveLaneMaskOpAdaptor::GetActiveLaneMaskOpAdaptor(GetActiveLaneMaskOp op) : GetActiveLaneMaskOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult GetActiveLaneMaskOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult GetActiveLaneMaskOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute GetActiveLaneMaskOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code GetActiveLaneMaskOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> GetActiveLaneMaskOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void GetActiveLaneMaskOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void GetActiveLaneMaskOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult GetActiveLaneMaskOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void GetActiveLaneMaskOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value base, ::mlir::Value n) {
odsState.addOperands(base);
odsState.addOperands(n);
odsState.addTypes(res);
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value base, ::mlir::Value n) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(base)>(base), std::forward<decltype(n)>(n));
auto __res__ = ::llvm::dyn_cast<GetActiveLaneMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value base, ::mlir::Value n) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(base)>(base), std::forward<decltype(n)>(n));
}
void GetActiveLaneMaskOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value base, ::mlir::Value n) {
odsState.addOperands(base);
odsState.addOperands(n);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value base, ::mlir::Value n) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(base)>(base), std::forward<decltype(n)>(n));
auto __res__ = ::llvm::dyn_cast<GetActiveLaneMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value base, ::mlir::Value n) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(base)>(base), std::forward<decltype(n)>(n));
}
void GetActiveLaneMaskOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<GetActiveLaneMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void GetActiveLaneMaskOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<GetActiveLaneMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
GetActiveLaneMaskOp GetActiveLaneMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult GetActiveLaneMaskOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult GetActiveLaneMaskOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult GetActiveLaneMaskOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand baseRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> baseOperands(&baseRawOperand, 1); ::llvm::SMLoc baseOperandsLoc;
(void)baseOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand nRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> nOperands(&nRawOperand, 1); ::llvm::SMLoc nOperandsLoc;
(void)nOperandsLoc;
::mlir::Type baseRawType{};
::llvm::ArrayRef<::mlir::Type> baseTypes(&baseRawType, 1);
::mlir::Type nRawType{};
::llvm::ArrayRef<::mlir::Type> nTypes(&nRawType, 1);
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
baseOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(baseRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
nOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(nRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::IntegerType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
baseRawType = type;
}
if (parser.parseComma())
return ::mlir::failure();
{
::mlir::IntegerType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
nRawType = type;
}
if (parser.parseKeyword("to"))
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
result.addTypes(resTypes);
if (parser.resolveOperands(baseOperands, baseTypes, baseOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(nOperands, nTypes, nOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void GetActiveLaneMaskOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getBase();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getN();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getBase().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::IntegerType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ",";
_odsPrinter << ' ';
{
auto type = getN().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::IntegerType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "to";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void GetActiveLaneMaskOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::GetActiveLaneMaskOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::InvariantEndOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
InvariantEndOpGenericAdaptorBase::InvariantEndOpGenericAdaptorBase(InvariantEndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t InvariantEndOpGenericAdaptorBase::getSize() {
auto attr = getSizeAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
InvariantEndOpAdaptor::InvariantEndOpAdaptor(InvariantEndOp op) : InvariantEndOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult InvariantEndOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_size = getProperties().size; (void)tblgen_size;
if (!tblgen_size) return emitError(loc, "'llvm.intr.invariant.end' op requires attribute 'size'");
if (tblgen_size && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_size))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_size).getType().isSignlessInteger(64)))))
return emitError(loc, "'llvm.intr.invariant.end' op attribute 'size' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult InvariantEndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.size;
auto attr = dict.get("size");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `size` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute InvariantEndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.size;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("size",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code InvariantEndOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.size.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> InvariantEndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "size")
return prop.size;
return std::nullopt;
}
void InvariantEndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "size") {
prop.size = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.size)>>(value);
return;
}
}
void InvariantEndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.size) attrs.append("size", prop.size);
}
::llvm::LogicalResult InvariantEndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getSizeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(attr, "size", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult InvariantEndOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.size)))
return ::mlir::failure();
return ::mlir::success();
}
void InvariantEndOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.size);
}
uint64_t InvariantEndOp::getSize() {
auto attr = getSizeAttr();
return attr.getValue().getZExtValue();
}
void InvariantEndOp::setSize(uint64_t attrValue) {
getProperties().size = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void InvariantEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value start, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
odsState.addOperands(start);
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = size;
}
InvariantEndOp InvariantEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value start, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantEndOp InvariantEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value start, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
odsState.addOperands(start);
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = size;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
InvariantEndOp InvariantEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value start, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantEndOp InvariantEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value start, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value start, uint64_t size, ::mlir::Value ptr) {
odsState.addOperands(start);
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), size);
}
InvariantEndOp InvariantEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value start, uint64_t size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantEndOp InvariantEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value start, uint64_t size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start, uint64_t size, ::mlir::Value ptr) {
odsState.addOperands(start);
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), size);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
InvariantEndOp InvariantEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value start, uint64_t size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantEndOp InvariantEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value start, uint64_t size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start)>(start), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<InvariantEndOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
InvariantEndOp InvariantEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<InvariantEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantEndOp InvariantEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void InvariantEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
InvariantEndOp InvariantEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<InvariantEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantEndOp InvariantEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult InvariantEndOp::verifyInvariantsImpl() {
auto tblgen_size = getProperties().size; (void)tblgen_size;
if (!tblgen_size) return emitOpError("requires attribute 'size'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(*this, tblgen_size, "size")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps10(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult InvariantEndOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult InvariantEndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand startRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> startOperands(&startRawOperand, 1); ::llvm::SMLoc startOperandsLoc;
(void)startOperandsLoc;
::mlir::IntegerAttr sizeAttr;
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::Type ptrRawType{};
::llvm::ArrayRef<::mlir::Type> ptrTypes(&ptrRawType, 1);
startOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(startRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(sizeAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (sizeAttr) result.getOrAddProperties<InvariantEndOp::Properties>().size = sizeAttr;
if (parser.parseComma())
return ::mlir::failure();
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(ptrRawType))
return ::mlir::failure();
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<::mlir::LLVM::LLVMPointerType>(0);
if (parser.resolveOperands(startOperands, odsBuildableType0, startOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(ptrOperands, ptrTypes, ptrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void InvariantEndOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getStart();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getSizeAttr());
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getPtr();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("size");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getPtr().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::InvariantEndOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::InvariantEndOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::InvariantStartOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
InvariantStartOpGenericAdaptorBase::InvariantStartOpGenericAdaptorBase(InvariantStartOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t InvariantStartOpGenericAdaptorBase::getSize() {
auto attr = getSizeAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
InvariantStartOpAdaptor::InvariantStartOpAdaptor(InvariantStartOp op) : InvariantStartOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult InvariantStartOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_size = getProperties().size; (void)tblgen_size;
if (!tblgen_size) return emitError(loc, "'llvm.intr.invariant.start' op requires attribute 'size'");
if (tblgen_size && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_size))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_size).getType().isSignlessInteger(64)))))
return emitError(loc, "'llvm.intr.invariant.start' op attribute 'size' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult InvariantStartOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.size;
auto attr = dict.get("size");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `size` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute InvariantStartOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.size;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("size",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code InvariantStartOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.size.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> InvariantStartOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "size")
return prop.size;
return std::nullopt;
}
void InvariantStartOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "size") {
prop.size = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.size)>>(value);
return;
}
}
void InvariantStartOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.size) attrs.append("size", prop.size);
}
::llvm::LogicalResult InvariantStartOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getSizeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(attr, "size", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult InvariantStartOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.size)))
return ::mlir::failure();
return ::mlir::success();
}
void InvariantStartOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.size);
}
uint64_t InvariantStartOp::getSize() {
auto attr = getSizeAttr();
return attr.getValue().getZExtValue();
}
void InvariantStartOp::setSize(uint64_t attrValue) {
getProperties().size = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = size;
odsState.addTypes(res);
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = size;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(InvariantStartOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = size;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, uint64_t size, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), size);
odsState.addTypes(res);
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, uint64_t size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, uint64_t size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, uint64_t size, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), size);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(InvariantStartOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, uint64_t size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, uint64_t size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint64_t size, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.getOrAddProperties<Properties>().size = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), size);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, uint64_t size, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, uint64_t size, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(size)>(size), std::forward<decltype(ptr)>(ptr));
}
void InvariantStartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<InvariantStartOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<InvariantStartOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(InvariantStartOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void InvariantStartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void InvariantStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(InvariantStartOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
InvariantStartOp InvariantStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<InvariantStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
InvariantStartOp InvariantStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult InvariantStartOp::verifyInvariantsImpl() {
auto tblgen_size = getProperties().size; (void)tblgen_size;
if (!tblgen_size) return emitOpError("requires attribute 'size'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(*this, tblgen_size, "size")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps10(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult InvariantStartOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult InvariantStartOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
::mlir::Type odsInferredType0 = odsBuilder.getType<::mlir::LLVM::LLVMPointerType>(0);
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult InvariantStartOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::IntegerAttr sizeAttr;
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::Type ptrRawType{};
::llvm::ArrayRef<::mlir::Type> ptrTypes(&ptrRawType, 1);
if (parser.parseCustomAttributeWithFallback(sizeAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (sizeAttr) result.getOrAddProperties<InvariantStartOp::Properties>().size = sizeAttr;
if (parser.parseComma())
return ::mlir::failure();
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(ptrRawType))
return ::mlir::failure();
::mlir::Type odsBuildableType0 = parser.getBuilder().getType<::mlir::LLVM::LLVMPointerType>(0);
result.addTypes(odsBuildableType0);
if (parser.resolveOperands(ptrOperands, ptrTypes, ptrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void InvariantStartOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter.printAttributeWithoutType(getSizeAttr());
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getPtr();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("size");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getPtr().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::InvariantStartOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::InvariantStartOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::IsConstantOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
IsConstantOpGenericAdaptorBase::IsConstantOpGenericAdaptorBase(IsConstantOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
IsConstantOpAdaptor::IsConstantOpAdaptor(IsConstantOp op) : IsConstantOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult IsConstantOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult IsConstantOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute IsConstantOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code IsConstantOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> IsConstantOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void IsConstantOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void IsConstantOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult IsConstantOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void IsConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val) {
odsState.addOperands(val);
odsState.addTypes(res);
}
IsConstantOp IsConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<IsConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsConstantOp IsConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
}
void IsConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val) {
odsState.addOperands(val);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(IsConstantOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
IsConstantOp IsConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<IsConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsConstantOp IsConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(val)>(val));
}
void IsConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
odsState.addOperands(val);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
IsConstantOp IsConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<IsConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsConstantOp IsConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
}
void IsConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
IsConstantOp IsConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<IsConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsConstantOp IsConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void IsConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(IsConstantOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
IsConstantOp IsConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<IsConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsConstantOp IsConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void IsConstantOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
IsConstantOp IsConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<IsConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsConstantOp IsConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void IsConstantOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(IsConstantOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
IsConstantOp IsConstantOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<IsConstantOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsConstantOp IsConstantOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult IsConstantOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps7(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult IsConstantOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult IsConstantOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
::mlir::Type odsInferredType0 = odsBuilder.getIntegerType(1);
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::llvm::LogicalResult IsConstantOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void IsConstantOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::IsConstantOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::IsFPClass definitions
//===----------------------------------------------------------------------===//
namespace detail {
IsFPClassGenericAdaptorBase::IsFPClassGenericAdaptorBase(IsFPClass op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint32_t IsFPClassGenericAdaptorBase::getBit() {
auto attr = getBitAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
IsFPClassAdaptor::IsFPClassAdaptor(IsFPClass op) : IsFPClassGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult IsFPClassAdaptor::verify(::mlir::Location loc) {
auto tblgen_bit = getProperties().bit; (void)tblgen_bit;
if (!tblgen_bit) return emitError(loc, "'llvm.intr.is.fpclass' op requires attribute 'bit'");
if (tblgen_bit && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_bit))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_bit).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.is.fpclass' op attribute 'bit' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult IsFPClass::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.bit;
auto attr = dict.get("bit");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `bit` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute IsFPClass::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.bit;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("bit",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code IsFPClass::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.bit.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> IsFPClass::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "bit")
return prop.bit;
return std::nullopt;
}
void IsFPClass::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "bit") {
prop.bit = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.bit)>>(value);
return;
}
}
void IsFPClass::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.bit) attrs.append("bit", prop.bit);
}
::llvm::LogicalResult IsFPClass::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getBitAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "bit", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult IsFPClass::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.bit)))
return ::mlir::failure();
return ::mlir::success();
}
void IsFPClass::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.bit);
}
uint32_t IsFPClass::getBit() {
auto attr = getBitAttr();
return attr.getValue().getZExtValue();
}
void IsFPClass::setBit(uint32_t attrValue) {
getProperties().bit = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void IsFPClass::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr bit) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().bit = bit;
odsState.addTypes(res);
}
IsFPClass IsFPClass::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr bit) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
auto __res__ = ::llvm::dyn_cast<IsFPClass>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsFPClass IsFPClass::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::IntegerAttr bit) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
}
void IsFPClass::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr bit) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().bit = bit;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
IsFPClass IsFPClass::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr bit) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
auto __res__ = ::llvm::dyn_cast<IsFPClass>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsFPClass IsFPClass::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::IntegerAttr bit) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
}
void IsFPClass::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, uint32_t bit) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().bit = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), bit);
odsState.addTypes(res);
}
IsFPClass IsFPClass::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, uint32_t bit) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
auto __res__ = ::llvm::dyn_cast<IsFPClass>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsFPClass IsFPClass::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, uint32_t bit) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
}
void IsFPClass::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, uint32_t bit) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().bit = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), bit);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
IsFPClass IsFPClass::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, uint32_t bit) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
auto __res__ = ::llvm::dyn_cast<IsFPClass>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsFPClass IsFPClass::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, uint32_t bit) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(bit)>(bit));
}
void IsFPClass::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<IsFPClass::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
IsFPClass IsFPClass::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<IsFPClass>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsFPClass IsFPClass::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void IsFPClass::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
IsFPClass IsFPClass::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<IsFPClass>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
IsFPClass IsFPClass::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult IsFPClass::verifyInvariantsImpl() {
auto tblgen_bit = getProperties().bit; (void)tblgen_bit;
if (!tblgen_bit) return emitOpError("requires attribute 'bit'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_bit, "bit")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult IsFPClass::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult IsFPClass::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.bit;
auto bitAttrName = ::mlir::StringAttr::get(ctx, "bit");
auto attr = dict.get(bitAttrName);
usedKeys.insert(bitAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for bit in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `bit` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void IsFPClass::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::IsFPClass)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::IsFPClassGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LaunderInvariantGroupOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LaunderInvariantGroupOpGenericAdaptorBase::LaunderInvariantGroupOpGenericAdaptorBase(LaunderInvariantGroupOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
LaunderInvariantGroupOpAdaptor::LaunderInvariantGroupOpAdaptor(LaunderInvariantGroupOp op) : LaunderInvariantGroupOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LaunderInvariantGroupOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult LaunderInvariantGroupOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute LaunderInvariantGroupOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LaunderInvariantGroupOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> LaunderInvariantGroupOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void LaunderInvariantGroupOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void LaunderInvariantGroupOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult LaunderInvariantGroupOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void LaunderInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.addTypes(res);
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<LaunderInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr));
}
void LaunderInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ptr) {
odsState.addOperands(ptr);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(LaunderInvariantGroupOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<LaunderInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(ptr)>(ptr));
}
void LaunderInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
odsState.addOperands(ptr);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<LaunderInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
}
void LaunderInvariantGroupOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LaunderInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LaunderInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(LaunderInvariantGroupOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LaunderInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LaunderInvariantGroupOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LaunderInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void LaunderInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(LaunderInvariantGroupOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LaunderInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LaunderInvariantGroupOp LaunderInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult LaunderInvariantGroupOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LaunderInvariantGroupOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult LaunderInvariantGroupOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult LaunderInvariantGroupOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::Type ptrRawType{};
::llvm::ArrayRef<::mlir::Type> ptrTypes(&ptrRawType, 1);
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(ptrRawType))
return ::mlir::failure();
result.addTypes(ptrTypes[0]);
if (parser.resolveOperands(ptrOperands, ptrTypes, ptrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LaunderInvariantGroupOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getPtr();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getPtr().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LaunderInvariantGroupOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LifetimeEndOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LifetimeEndOpGenericAdaptorBase::LifetimeEndOpGenericAdaptorBase(LifetimeEndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
LifetimeEndOpAdaptor::LifetimeEndOpAdaptor(LifetimeEndOp op) : LifetimeEndOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LifetimeEndOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult LifetimeEndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute LifetimeEndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LifetimeEndOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> LifetimeEndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void LifetimeEndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void LifetimeEndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult LifetimeEndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void LifetimeEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ptr) {
odsState.addOperands(ptr);
}
LifetimeEndOp LifetimeEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<LifetimeEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeEndOp LifetimeEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(ptr)>(ptr));
}
void LifetimeEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
odsState.addOperands(ptr);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LifetimeEndOp LifetimeEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<LifetimeEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeEndOp LifetimeEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
}
void LifetimeEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LifetimeEndOp LifetimeEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LifetimeEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeEndOp LifetimeEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LifetimeEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LifetimeEndOp LifetimeEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LifetimeEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeEndOp LifetimeEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult LifetimeEndOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LifetimeEndOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult LifetimeEndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::Type ptrRawType{};
::llvm::ArrayRef<::mlir::Type> ptrTypes(&ptrRawType, 1);
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(ptrRawType))
return ::mlir::failure();
if (parser.resolveOperands(ptrOperands, ptrTypes, ptrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LifetimeEndOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getPtr();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getPtr().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LifetimeEndOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LifetimeStartOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LifetimeStartOpGenericAdaptorBase::LifetimeStartOpGenericAdaptorBase(LifetimeStartOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
LifetimeStartOpAdaptor::LifetimeStartOpAdaptor(LifetimeStartOp op) : LifetimeStartOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LifetimeStartOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult LifetimeStartOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute LifetimeStartOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LifetimeStartOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> LifetimeStartOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void LifetimeStartOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void LifetimeStartOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult LifetimeStartOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void LifetimeStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ptr) {
odsState.addOperands(ptr);
}
LifetimeStartOp LifetimeStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<LifetimeStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeStartOp LifetimeStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(ptr)>(ptr));
}
void LifetimeStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
odsState.addOperands(ptr);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LifetimeStartOp LifetimeStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<LifetimeStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeStartOp LifetimeStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
}
void LifetimeStartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LifetimeStartOp LifetimeStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LifetimeStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeStartOp LifetimeStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LifetimeStartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LifetimeStartOp LifetimeStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LifetimeStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LifetimeStartOp LifetimeStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult LifetimeStartOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LifetimeStartOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult LifetimeStartOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::Type ptrRawType{};
::llvm::ArrayRef<::mlir::Type> ptrTypes(&ptrRawType, 1);
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(ptrRawType))
return ::mlir::failure();
if (parser.resolveOperands(ptrOperands, ptrTypes, ptrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LifetimeStartOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getPtr();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getPtr().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LifetimeStartOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LlrintOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LlrintOpGenericAdaptorBase::LlrintOpGenericAdaptorBase(LlrintOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
LlrintOpAdaptor::LlrintOpAdaptor(LlrintOp op) : LlrintOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LlrintOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult LlrintOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute LlrintOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LlrintOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> LlrintOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void LlrintOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void LlrintOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult LlrintOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void LlrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val) {
odsState.addOperands(val);
odsState.addTypes(res);
}
LlrintOp LlrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LlrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlrintOp LlrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
}
void LlrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
odsState.addOperands(val);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LlrintOp LlrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LlrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlrintOp LlrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
}
void LlrintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LlrintOp LlrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LlrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlrintOp LlrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LlrintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LlrintOp LlrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LlrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlrintOp LlrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult LlrintOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LlrintOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult LlrintOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LlrintOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void LlrintOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LlrintOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LlroundOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LlroundOpGenericAdaptorBase::LlroundOpGenericAdaptorBase(LlroundOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
LlroundOpAdaptor::LlroundOpAdaptor(LlroundOp op) : LlroundOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LlroundOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult LlroundOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute LlroundOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LlroundOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> LlroundOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void LlroundOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void LlroundOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult LlroundOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void LlroundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val) {
odsState.addOperands(val);
odsState.addTypes(res);
}
LlroundOp LlroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LlroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlroundOp LlroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
}
void LlroundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
odsState.addOperands(val);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LlroundOp LlroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LlroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlroundOp LlroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
}
void LlroundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LlroundOp LlroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LlroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlroundOp LlroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LlroundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LlroundOp LlroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LlroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LlroundOp LlroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult LlroundOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps11(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LlroundOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult LlroundOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LlroundOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void LlroundOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LlroundOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LoadExpOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LoadExpOpGenericAdaptorBase::LoadExpOpGenericAdaptorBase(LoadExpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr LoadExpOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags LoadExpOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
LoadExpOpAdaptor::LoadExpOpAdaptor(LoadExpOp op) : LoadExpOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LoadExpOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.ldexp' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult LoadExpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute LoadExpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LoadExpOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> LoadExpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void LoadExpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void LoadExpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult LoadExpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult LoadExpOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void LoadExpOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags LoadExpOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void LoadExpOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void LoadExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
LoadExpOp LoadExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LoadExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LoadExpOp LoadExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LoadExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LoadExpOp LoadExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LoadExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LoadExpOp LoadExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LoadExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
LoadExpOp LoadExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LoadExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LoadExpOp LoadExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LoadExpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LoadExpOp LoadExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LoadExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LoadExpOp LoadExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LoadExpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<LoadExpOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
LoadExpOp LoadExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LoadExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LoadExpOp LoadExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LoadExpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LoadExpOp LoadExpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LoadExpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LoadExpOp LoadExpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void LoadExpOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult LoadExpOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LoadExpOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult LoadExpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LoadExpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void LoadExpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LoadExpOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::LoadExpOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::Log10Op definitions
//===----------------------------------------------------------------------===//
namespace detail {
Log10OpGenericAdaptorBase::Log10OpGenericAdaptorBase(Log10Op op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr Log10OpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags Log10OpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
Log10OpAdaptor::Log10OpAdaptor(Log10Op op) : Log10OpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult Log10OpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.log10' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult Log10Op::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute Log10Op::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code Log10Op::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> Log10Op::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void Log10Op::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void Log10Op::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult Log10Op::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult Log10Op::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void Log10Op::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags Log10Op::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void Log10Op::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log10Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Log10Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Log10Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Log10Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Log10Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log10Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Log10Op Log10Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Log10Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log10Op Log10Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Log10Op::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult Log10Op::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult Log10Op::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult Log10Op::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult Log10Op::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void Log10Op::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void Log10Op::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::Log10Op)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::Log10OpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::Log2Op definitions
//===----------------------------------------------------------------------===//
namespace detail {
Log2OpGenericAdaptorBase::Log2OpGenericAdaptorBase(Log2Op op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr Log2OpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags Log2OpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
Log2OpAdaptor::Log2OpAdaptor(Log2Op op) : Log2OpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult Log2OpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.log2' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult Log2Op::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute Log2Op::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code Log2Op::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> Log2Op::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void Log2Op::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void Log2Op::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult Log2Op::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult Log2Op::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void Log2Op::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags Log2Op::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void Log2Op::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void Log2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Log2Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Log2Op::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Log2Op::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Log2Op::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(Log2Op::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
Log2Op Log2Op::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Log2Op>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Log2Op Log2Op::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void Log2Op::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult Log2Op::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult Log2Op::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult Log2Op::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult Log2Op::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void Log2Op::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void Log2Op::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::Log2Op)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::Log2OpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LogOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LogOpGenericAdaptorBase::LogOpGenericAdaptorBase(LogOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr LogOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags LogOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
LogOpAdaptor::LogOpAdaptor(LogOp op) : LogOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LogOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.log' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult LogOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute LogOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LogOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> LogOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void LogOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void LogOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult LogOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult LogOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void LogOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags LogOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void LogOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(LogOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(LogOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void LogOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<LogOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<LogOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(LogOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LogOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void LogOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(LogOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
LogOp LogOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LogOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LogOp LogOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void LogOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult LogOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LogOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult LogOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult LogOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LogOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void LogOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LogOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::LogOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LrintOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LrintOpGenericAdaptorBase::LrintOpGenericAdaptorBase(LrintOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
LrintOpAdaptor::LrintOpAdaptor(LrintOp op) : LrintOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LrintOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult LrintOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute LrintOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LrintOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> LrintOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void LrintOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void LrintOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult LrintOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void LrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val) {
odsState.addOperands(val);
odsState.addTypes(res);
}
LrintOp LrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LrintOp LrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
}
void LrintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
odsState.addOperands(val);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LrintOp LrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LrintOp LrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
}
void LrintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LrintOp LrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LrintOp LrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LrintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LrintOp LrintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LrintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LrintOp LrintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult LrintOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LrintOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult LrintOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LrintOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void LrintOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LrintOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::LroundOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
LroundOpGenericAdaptorBase::LroundOpGenericAdaptorBase(LroundOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
LroundOpAdaptor::LroundOpAdaptor(LroundOp op) : LroundOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult LroundOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult LroundOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute LroundOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code LroundOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> LroundOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void LroundOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void LroundOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult LroundOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void LroundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val) {
odsState.addOperands(val);
odsState.addTypes(res);
}
LroundOp LroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LroundOp LroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val));
}
void LroundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
odsState.addOperands(val);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
LroundOp LroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
auto __res__ = ::llvm::dyn_cast<LroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LroundOp LroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val));
}
void LroundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LroundOp LroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<LroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LroundOp LroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void LroundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
LroundOp LroundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<LroundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
LroundOp LroundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult LroundOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult LroundOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult LroundOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void LroundOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void LroundOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::LroundOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MaskedLoadOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MaskedLoadOpGenericAdaptorBase::MaskedLoadOpGenericAdaptorBase(MaskedLoadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> MaskedLoadOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
bool isVariadic[] = {false, false, true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (odsOperandsSize - 2) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
uint32_t MaskedLoadOpGenericAdaptorBase::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
::mlir::UnitAttr MaskedLoadOpGenericAdaptorBase::getNontemporalAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().nontemporal);
if (!attr)
attr = ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr);
return attr;
}
bool MaskedLoadOpGenericAdaptorBase::getNontemporal() {
auto attr = getNontemporalAttr();
if (!attr)
return ((false) ? ::mlir::Builder(odsAttrs.getContext()).getUnitAttr() : nullptr) != nullptr;
return attr != nullptr;
}
} // namespace detail
MaskedLoadOpAdaptor::MaskedLoadOpAdaptor(MaskedLoadOp op) : MaskedLoadOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MaskedLoadOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitError(loc, "'llvm.intr.masked.load' op requires attribute 'alignment'");
auto tblgen_nontemporal = getProperties().nontemporal; (void)tblgen_nontemporal;
if (tblgen_alignment && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_alignment))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_alignment).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.masked.load' op attribute 'alignment' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_nontemporal && !((::llvm::isa<::mlir::UnitAttr>(tblgen_nontemporal))))
return emitError(loc, "'llvm.intr.masked.load' op attribute 'nontemporal' failed to satisfy constraint: unit attribute");
return ::mlir::success();
}
std::pair<unsigned, unsigned> MaskedLoadOp::getODSOperandIndexAndLength(unsigned index) {
bool isVariadic[] = {false, false, true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
::mlir::MutableOperandRange MaskedLoadOp::getPassThruMutable() {
auto range = getODSOperandIndexAndLength(2);
auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
return mutableRange;
}
::llvm::LogicalResult MaskedLoadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.alignment;
auto attr = dict.get("alignment");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alignment` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.nontemporal;
auto attr = dict.get("nontemporal");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `nontemporal` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MaskedLoadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.alignment;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alignment",
propStorage));
}
{
const auto &propStorage = prop.nontemporal;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("nontemporal",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MaskedLoadOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.alignment.getAsOpaquePointer()),
llvm::hash_value(prop.nontemporal.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MaskedLoadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "alignment")
return prop.alignment;
if (name == "nontemporal")
return prop.nontemporal;
return std::nullopt;
}
void MaskedLoadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "alignment") {
prop.alignment = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alignment)>>(value);
return;
}
if (name == "nontemporal") {
prop.nontemporal = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.nontemporal)>>(value);
return;
}
}
void MaskedLoadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.alignment) attrs.append("alignment", prop.alignment);
if (prop.nontemporal) attrs.append("nontemporal", prop.nontemporal);
}
::llvm::LogicalResult MaskedLoadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAlignmentAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "alignment", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getNontemporalAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps13(attr, "nontemporal", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MaskedLoadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.alignment)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.nontemporal)))
return ::mlir::failure();
return ::mlir::success();
}
void MaskedLoadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.alignment);
writer.writeOptionalAttribute(prop.nontemporal);
}
uint32_t MaskedLoadOp::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
bool MaskedLoadOp::getNontemporal() {
auto attr = getNontemporalAttr();
if (!attr)
return ((false) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr) != nullptr;
return attr != nullptr;
}
void MaskedLoadOp::setAlignment(uint32_t attrValue) {
getProperties().alignment = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MaskedLoadOp::setNontemporal(bool attrValue) {
auto &odsProp = getProperties().nontemporal;
if (attrValue)
odsProp = ((attrValue) ? ::mlir::Builder((*this)->getContext()).getUnitAttr() : nullptr);
else
odsProp = nullptr;
}
void MaskedLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, ::mlir::IntegerAttr alignment, /*optional*/::mlir::UnitAttr nontemporal) {
odsState.addOperands(data);
odsState.addOperands(mask);
if (pass_thru)
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = alignment;
if (nontemporal) {
odsState.getOrAddProperties<Properties>().nontemporal = nontemporal;
}
odsState.addTypes(res);
}
MaskedLoadOp MaskedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, ::mlir::IntegerAttr alignment, /*optional*/::mlir::UnitAttr nontemporal) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
auto __res__ = ::llvm::dyn_cast<MaskedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedLoadOp MaskedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, ::mlir::IntegerAttr alignment, /*optional*/::mlir::UnitAttr nontemporal) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
}
void MaskedLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, ::mlir::IntegerAttr alignment, /*optional*/::mlir::UnitAttr nontemporal) {
odsState.addOperands(data);
odsState.addOperands(mask);
if (pass_thru)
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = alignment;
if (nontemporal) {
odsState.getOrAddProperties<Properties>().nontemporal = nontemporal;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaskedLoadOp MaskedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, ::mlir::IntegerAttr alignment, /*optional*/::mlir::UnitAttr nontemporal) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
auto __res__ = ::llvm::dyn_cast<MaskedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedLoadOp MaskedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, ::mlir::IntegerAttr alignment, /*optional*/::mlir::UnitAttr nontemporal) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
}
void MaskedLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, uint32_t alignment, /*optional*/bool nontemporal) {
odsState.addOperands(data);
odsState.addOperands(mask);
if (pass_thru)
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
if (nontemporal) {
odsState.getOrAddProperties<Properties>().nontemporal = ((nontemporal) ? odsBuilder.getUnitAttr() : nullptr);
}
odsState.addTypes(res);
}
MaskedLoadOp MaskedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, uint32_t alignment, /*optional*/bool nontemporal) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
auto __res__ = ::llvm::dyn_cast<MaskedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedLoadOp MaskedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, uint32_t alignment, /*optional*/bool nontemporal) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
}
void MaskedLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, uint32_t alignment, /*optional*/bool nontemporal) {
odsState.addOperands(data);
odsState.addOperands(mask);
if (pass_thru)
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
if (nontemporal) {
odsState.getOrAddProperties<Properties>().nontemporal = ((nontemporal) ? odsBuilder.getUnitAttr() : nullptr);
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaskedLoadOp MaskedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, uint32_t alignment, /*optional*/bool nontemporal) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
auto __res__ = ::llvm::dyn_cast<MaskedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedLoadOp MaskedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value mask, /*optional*/::mlir::Value pass_thru, uint32_t alignment, /*optional*/bool nontemporal) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment), std::forward<decltype(nontemporal)>(nontemporal));
}
void MaskedLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() >= 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MaskedLoadOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MaskedLoadOp MaskedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaskedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedLoadOp MaskedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaskedLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() >= 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MaskedLoadOp MaskedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MaskedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedLoadOp MaskedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MaskedLoadOp::verifyInvariantsImpl() {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitOpError("requires attribute 'alignment'");
auto tblgen_nontemporal = getProperties().nontemporal; (void)tblgen_nontemporal;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_alignment, "alignment")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps13(*this, tblgen_nontemporal, "nontemporal")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
if (valueGroup2.size() > 1) {
return emitOpError("operand group starting at #") << index
<< " requires 0 or 1 element, but found " << valueGroup2.size();
}
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MaskedLoadOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult MaskedLoadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MaskedLoadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getOperation()->getOperands();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getNontemporalAttr();
if(attr && (attr == ((false) ? odsBuilder.getUnitAttr() : nullptr)))
elidedAttrs.push_back("nontemporal");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MaskedLoadOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MaskedLoadOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MaskedStoreOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MaskedStoreOpGenericAdaptorBase::MaskedStoreOpGenericAdaptorBase(MaskedStoreOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint32_t MaskedStoreOpGenericAdaptorBase::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
MaskedStoreOpAdaptor::MaskedStoreOpAdaptor(MaskedStoreOp op) : MaskedStoreOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MaskedStoreOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitError(loc, "'llvm.intr.masked.store' op requires attribute 'alignment'");
if (tblgen_alignment && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_alignment))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_alignment).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.masked.store' op attribute 'alignment' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult MaskedStoreOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.alignment;
auto attr = dict.get("alignment");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alignment` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MaskedStoreOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.alignment;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alignment",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MaskedStoreOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.alignment.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MaskedStoreOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "alignment")
return prop.alignment;
return std::nullopt;
}
void MaskedStoreOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "alignment") {
prop.alignment = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alignment)>>(value);
return;
}
}
void MaskedStoreOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.alignment) attrs.append("alignment", prop.alignment);
}
::llvm::LogicalResult MaskedStoreOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAlignmentAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "alignment", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MaskedStoreOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.alignment)))
return ::mlir::failure();
return ::mlir::success();
}
void MaskedStoreOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.alignment);
}
uint32_t MaskedStoreOp::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
void MaskedStoreOp::setAlignment(uint32_t attrValue) {
getProperties().alignment = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MaskedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
assert(isCompatibleType(resultType) && "result must be an LLVM type");
assert(::llvm::isa<LLVMVoidType>(resultType) &&
"for zero-result operands, only 'void' is accepted as result type");
build(odsBuilder, odsState, operands, attributes);
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaskedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
odsState.addOperands(operands);
for (auto namedAttr : attributes)
odsState.addAttribute(namedAttr.getName(), namedAttr.getValue());
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaskedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
odsState.addOperands(value);
odsState.addOperands(data);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = alignment;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void MaskedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
odsState.addOperands(value);
odsState.addOperands(data);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = alignment;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void MaskedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, uint32_t alignment) {
odsState.addOperands(value);
odsState.addOperands(data);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, uint32_t alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, uint32_t alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void MaskedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, uint32_t alignment) {
odsState.addOperands(value);
odsState.addOperands(data);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, uint32_t alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value data, ::mlir::Value mask, uint32_t alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(data)>(data), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void MaskedStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MaskedStoreOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaskedStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MaskedStoreOp MaskedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MaskedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaskedStoreOp MaskedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MaskedStoreOp::verifyInvariantsImpl() {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitOpError("requires attribute 'alignment'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_alignment, "alignment")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MaskedStoreOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult MaskedStoreOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
(void)valueOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand dataRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> dataOperands(&dataRawOperand, 1); ::llvm::SMLoc dataOperandsLoc;
(void)dataOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand maskRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> maskOperands(&maskRawOperand, 1); ::llvm::SMLoc maskOperandsLoc;
(void)maskOperandsLoc;
::mlir::Type valueRawType{};
::llvm::ArrayRef<::mlir::Type> valueTypes(&valueRawType, 1);
::mlir::Type maskRawType{};
::llvm::ArrayRef<::mlir::Type> maskTypes(&maskRawType, 1);
::mlir::Type dataRawType{};
::llvm::ArrayRef<::mlir::Type> dataTypes(&dataRawType, 1);
valueOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(valueRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
dataOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(dataRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
maskOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(maskRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
valueRawType = type;
}
if (parser.parseComma())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
maskRawType = type;
}
if (parser.parseKeyword("into"))
return ::mlir::failure();
if (parser.parseType(dataRawType))
return ::mlir::failure();
if (parser.resolveOperands(valueOperands, valueTypes, valueOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(dataOperands, dataTypes, dataOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(maskOperands, maskTypes, maskOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MaskedStoreOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getValue();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getData();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getMask();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getValue().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ",";
_odsPrinter << ' ';
{
auto type = getMask().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "into";
_odsPrinter << ' ';
_odsPrinter << getData().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MaskedStoreOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MaskedStoreOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MatrixColumnMajorLoadOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MatrixColumnMajorLoadOpGenericAdaptorBase::MatrixColumnMajorLoadOpGenericAdaptorBase(MatrixColumnMajorLoadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool MatrixColumnMajorLoadOpGenericAdaptorBase::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorLoadOpGenericAdaptorBase::getRows() {
auto attr = getRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorLoadOpGenericAdaptorBase::getColumns() {
auto attr = getColumnsAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
MatrixColumnMajorLoadOpAdaptor::MatrixColumnMajorLoadOpAdaptor(MatrixColumnMajorLoadOp op) : MatrixColumnMajorLoadOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MatrixColumnMajorLoadOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_columns = getProperties().columns; (void)tblgen_columns;
if (!tblgen_columns) return emitError(loc, "'llvm.intr.matrix.column.major.load' op requires attribute 'columns'");
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitError(loc, "'llvm.intr.matrix.column.major.load' op requires attribute 'isVolatile'");
auto tblgen_rows = getProperties().rows; (void)tblgen_rows;
if (!tblgen_rows) return emitError(loc, "'llvm.intr.matrix.column.major.load' op requires attribute 'rows'");
if (tblgen_isVolatile && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_isVolatile))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_isVolatile).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.matrix.column.major.load' op attribute 'isVolatile' failed to satisfy constraint: 1-bit signless integer attribute");
if (tblgen_rows && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_rows))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_rows).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.column.major.load' op attribute 'rows' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_columns && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_columns))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_columns).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.column.major.load' op attribute 'columns' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult MatrixColumnMajorLoadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.columns;
auto attr = dict.get("columns");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `columns` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto attr = dict.get("isVolatile");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.rows;
auto attr = dict.get("rows");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `rows` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MatrixColumnMajorLoadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.columns;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("columns",
propStorage));
}
{
const auto &propStorage = prop.isVolatile;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("isVolatile",
propStorage));
}
{
const auto &propStorage = prop.rows;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("rows",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MatrixColumnMajorLoadOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.columns.getAsOpaquePointer()),
llvm::hash_value(prop.isVolatile.getAsOpaquePointer()),
llvm::hash_value(prop.rows.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MatrixColumnMajorLoadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "columns")
return prop.columns;
if (name == "isVolatile")
return prop.isVolatile;
if (name == "rows")
return prop.rows;
return std::nullopt;
}
void MatrixColumnMajorLoadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "columns") {
prop.columns = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.columns)>>(value);
return;
}
if (name == "isVolatile") {
prop.isVolatile = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.isVolatile)>>(value);
return;
}
if (name == "rows") {
prop.rows = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.rows)>>(value);
return;
}
}
void MatrixColumnMajorLoadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.columns) attrs.append("columns", prop.columns);
if (prop.isVolatile) attrs.append("isVolatile", prop.isVolatile);
if (prop.rows) attrs.append("rows", prop.rows);
}
::llvm::LogicalResult MatrixColumnMajorLoadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getColumnsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "columns", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getIsVolatileAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "isVolatile", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRowsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "rows", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixColumnMajorLoadOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.columns)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.isVolatile)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.rows)))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixColumnMajorLoadOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.columns);
writer.writeAttribute(prop.isVolatile);
writer.writeAttribute(prop.rows);
}
bool MatrixColumnMajorLoadOp::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorLoadOp::getRows() {
auto attr = getRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorLoadOp::getColumns() {
auto attr = getColumnsAttr();
return attr.getValue().getZExtValue();
}
void MatrixColumnMajorLoadOp::setIsVolatile(bool attrValue) {
getProperties().isVolatile = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void MatrixColumnMajorLoadOp::setRows(uint32_t attrValue) {
getProperties().rows = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixColumnMajorLoadOp::setColumns(uint32_t attrValue) {
getProperties().columns = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixColumnMajorLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
if (resultType) odsState.addTypes(resultType);
odsState.addOperands(operands);
for (auto namedAttr : attributes)
odsState.addAttribute(namedAttr.getName(), namedAttr.getValue());
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixColumnMajorLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
odsState.getOrAddProperties<Properties>().rows = rows;
odsState.getOrAddProperties<Properties>().columns = columns;
odsState.addTypes(res);
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
odsState.getOrAddProperties<Properties>().rows = rows;
odsState.getOrAddProperties<Properties>().columns = columns;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
odsState.getOrAddProperties<Properties>().rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rows);
odsState.getOrAddProperties<Properties>().columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), columns);
odsState.addTypes(res);
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
odsState.getOrAddProperties<Properties>().rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rows);
odsState.getOrAddProperties<Properties>().columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), columns);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MatrixColumnMajorLoadOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixColumnMajorLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorLoadOp MatrixColumnMajorLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MatrixColumnMajorLoadOp::verifyInvariantsImpl() {
auto tblgen_columns = getProperties().columns; (void)tblgen_columns;
if (!tblgen_columns) return emitOpError("requires attribute 'columns'");
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitOpError("requires attribute 'isVolatile'");
auto tblgen_rows = getProperties().rows; (void)tblgen_rows;
if (!tblgen_rows) return emitOpError("requires attribute 'rows'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_isVolatile, "isVolatile")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_rows, "rows")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_columns, "columns")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixColumnMajorLoadOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult MatrixColumnMajorLoadOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand dataRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> dataOperands(&dataRawOperand, 1); ::llvm::SMLoc dataOperandsLoc;
(void)dataOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand strideRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> strideOperands(&strideRawOperand, 1); ::llvm::SMLoc strideOperandsLoc;
(void)strideOperandsLoc;
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
::mlir::Type dataRawType{};
::llvm::ArrayRef<::mlir::Type> dataTypes(&dataRawType, 1);
::mlir::Type strideRawType{};
::llvm::ArrayRef<::mlir::Type> strideTypes(&strideRawType, 1);
dataOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(dataRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseLess())
return ::mlir::failure();
if (parser.parseKeyword("stride"))
return ::mlir::failure();
if (parser.parseEqual())
return ::mlir::failure();
strideOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(strideRawOperand))
return ::mlir::failure();
if (parser.parseGreater())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
if (parser.parseKeyword("from"))
return ::mlir::failure();
if (parser.parseType(dataRawType))
return ::mlir::failure();
if (parser.parseKeyword("stride"))
return ::mlir::failure();
{
::mlir::IntegerType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
strideRawType = type;
}
result.addTypes(resTypes);
if (parser.resolveOperands(dataOperands, dataTypes, dataOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(strideOperands, strideTypes, strideOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixColumnMajorLoadOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getData();
_odsPrinter << ",";
_odsPrinter << ' ' << "<";
_odsPrinter << "stride";
_odsPrinter << ' ' << "=";
_odsPrinter << ' ';
_odsPrinter << getStride();
_odsPrinter << ">";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "from";
_odsPrinter << ' ';
_odsPrinter << getData().getType();
_odsPrinter << ' ' << "stride";
_odsPrinter << ' ';
{
auto type = getStride().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::IntegerType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MatrixColumnMajorLoadOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MatrixColumnMajorLoadOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MatrixColumnMajorStoreOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MatrixColumnMajorStoreOpGenericAdaptorBase::MatrixColumnMajorStoreOpGenericAdaptorBase(MatrixColumnMajorStoreOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool MatrixColumnMajorStoreOpGenericAdaptorBase::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorStoreOpGenericAdaptorBase::getRows() {
auto attr = getRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorStoreOpGenericAdaptorBase::getColumns() {
auto attr = getColumnsAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
MatrixColumnMajorStoreOpAdaptor::MatrixColumnMajorStoreOpAdaptor(MatrixColumnMajorStoreOp op) : MatrixColumnMajorStoreOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MatrixColumnMajorStoreOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_columns = getProperties().columns; (void)tblgen_columns;
if (!tblgen_columns) return emitError(loc, "'llvm.intr.matrix.column.major.store' op requires attribute 'columns'");
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitError(loc, "'llvm.intr.matrix.column.major.store' op requires attribute 'isVolatile'");
auto tblgen_rows = getProperties().rows; (void)tblgen_rows;
if (!tblgen_rows) return emitError(loc, "'llvm.intr.matrix.column.major.store' op requires attribute 'rows'");
if (tblgen_isVolatile && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_isVolatile))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_isVolatile).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.matrix.column.major.store' op attribute 'isVolatile' failed to satisfy constraint: 1-bit signless integer attribute");
if (tblgen_rows && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_rows))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_rows).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.column.major.store' op attribute 'rows' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_columns && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_columns))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_columns).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.column.major.store' op attribute 'columns' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult MatrixColumnMajorStoreOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.columns;
auto attr = dict.get("columns");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `columns` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto attr = dict.get("isVolatile");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.rows;
auto attr = dict.get("rows");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `rows` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MatrixColumnMajorStoreOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.columns;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("columns",
propStorage));
}
{
const auto &propStorage = prop.isVolatile;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("isVolatile",
propStorage));
}
{
const auto &propStorage = prop.rows;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("rows",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MatrixColumnMajorStoreOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.columns.getAsOpaquePointer()),
llvm::hash_value(prop.isVolatile.getAsOpaquePointer()),
llvm::hash_value(prop.rows.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MatrixColumnMajorStoreOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "columns")
return prop.columns;
if (name == "isVolatile")
return prop.isVolatile;
if (name == "rows")
return prop.rows;
return std::nullopt;
}
void MatrixColumnMajorStoreOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "columns") {
prop.columns = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.columns)>>(value);
return;
}
if (name == "isVolatile") {
prop.isVolatile = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.isVolatile)>>(value);
return;
}
if (name == "rows") {
prop.rows = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.rows)>>(value);
return;
}
}
void MatrixColumnMajorStoreOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.columns) attrs.append("columns", prop.columns);
if (prop.isVolatile) attrs.append("isVolatile", prop.isVolatile);
if (prop.rows) attrs.append("rows", prop.rows);
}
::llvm::LogicalResult MatrixColumnMajorStoreOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getColumnsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "columns", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getIsVolatileAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "isVolatile", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRowsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "rows", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixColumnMajorStoreOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.columns)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.isVolatile)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.rows)))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixColumnMajorStoreOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.columns);
writer.writeAttribute(prop.isVolatile);
writer.writeAttribute(prop.rows);
}
bool MatrixColumnMajorStoreOp::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorStoreOp::getRows() {
auto attr = getRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixColumnMajorStoreOp::getColumns() {
auto attr = getColumnsAttr();
return attr.getValue().getZExtValue();
}
void MatrixColumnMajorStoreOp::setIsVolatile(bool attrValue) {
getProperties().isVolatile = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void MatrixColumnMajorStoreOp::setRows(uint32_t attrValue) {
getProperties().rows = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixColumnMajorStoreOp::setColumns(uint32_t attrValue) {
getProperties().columns = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
assert(isCompatibleType(resultType) && "result must be an LLVM type");
assert(::llvm::isa<LLVMVoidType>(resultType) &&
"for zero-result operands, only 'void' is accepted as result type");
build(odsBuilder, odsState, operands, attributes);
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
odsState.addOperands(operands);
for (auto namedAttr : attributes)
odsState.addAttribute(namedAttr.getName(), namedAttr.getValue());
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
odsState.addOperands(matrix);
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
odsState.getOrAddProperties<Properties>().rows = rows;
odsState.getOrAddProperties<Properties>().columns = columns;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
return create(builder, builder.getLoc(), std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
odsState.addOperands(matrix);
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
odsState.getOrAddProperties<Properties>().rows = rows;
odsState.getOrAddProperties<Properties>().columns = columns;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, ::mlir::IntegerAttr isVolatile, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
odsState.addOperands(matrix);
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
odsState.getOrAddProperties<Properties>().rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rows);
odsState.getOrAddProperties<Properties>().columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), columns);
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
return create(builder, builder.getLoc(), std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
odsState.addOperands(matrix);
odsState.addOperands(data);
odsState.addOperands(stride);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
odsState.getOrAddProperties<Properties>().rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rows);
odsState.getOrAddProperties<Properties>().columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), columns);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::Value data, ::mlir::Value stride, bool isVolatile, uint32_t rows, uint32_t columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(data)>(data), std::forward<decltype(stride)>(stride), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MatrixColumnMajorStoreOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixColumnMajorStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MatrixColumnMajorStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixColumnMajorStoreOp MatrixColumnMajorStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MatrixColumnMajorStoreOp::verifyInvariantsImpl() {
auto tblgen_columns = getProperties().columns; (void)tblgen_columns;
if (!tblgen_columns) return emitOpError("requires attribute 'columns'");
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitOpError("requires attribute 'isVolatile'");
auto tblgen_rows = getProperties().rows; (void)tblgen_rows;
if (!tblgen_rows) return emitOpError("requires attribute 'rows'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_isVolatile, "isVolatile")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_rows, "rows")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_columns, "columns")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixColumnMajorStoreOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult MatrixColumnMajorStoreOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand matrixRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> matrixOperands(&matrixRawOperand, 1); ::llvm::SMLoc matrixOperandsLoc;
(void)matrixOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand dataRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> dataOperands(&dataRawOperand, 1); ::llvm::SMLoc dataOperandsLoc;
(void)dataOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand strideRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> strideOperands(&strideRawOperand, 1); ::llvm::SMLoc strideOperandsLoc;
(void)strideOperandsLoc;
::mlir::Type matrixRawType{};
::llvm::ArrayRef<::mlir::Type> matrixTypes(&matrixRawType, 1);
::mlir::Type dataRawType{};
::llvm::ArrayRef<::mlir::Type> dataTypes(&dataRawType, 1);
::mlir::Type strideRawType{};
::llvm::ArrayRef<::mlir::Type> strideTypes(&strideRawType, 1);
matrixOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(matrixRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
dataOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(dataRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
if (parser.parseLess())
return ::mlir::failure();
if (parser.parseKeyword("stride"))
return ::mlir::failure();
if (parser.parseEqual())
return ::mlir::failure();
strideOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(strideRawOperand))
return ::mlir::failure();
if (parser.parseGreater())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
matrixRawType = type;
}
if (parser.parseKeyword("to"))
return ::mlir::failure();
if (parser.parseType(dataRawType))
return ::mlir::failure();
if (parser.parseKeyword("stride"))
return ::mlir::failure();
{
::mlir::IntegerType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
strideRawType = type;
}
if (parser.resolveOperands(matrixOperands, matrixTypes, matrixOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(dataOperands, dataTypes, dataOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(strideOperands, strideTypes, strideOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixColumnMajorStoreOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getMatrix();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getData();
_odsPrinter << ",";
_odsPrinter << ' ' << "<";
_odsPrinter << "stride";
_odsPrinter << ' ' << "=";
_odsPrinter << ' ';
_odsPrinter << getStride();
_odsPrinter << ">";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getMatrix().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "to";
_odsPrinter << ' ';
_odsPrinter << getData().getType();
_odsPrinter << ' ' << "stride";
_odsPrinter << ' ';
{
auto type = getStride().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::IntegerType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MatrixColumnMajorStoreOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MatrixColumnMajorStoreOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MatrixMultiplyOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MatrixMultiplyOpGenericAdaptorBase::MatrixMultiplyOpGenericAdaptorBase(MatrixMultiplyOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint32_t MatrixMultiplyOpGenericAdaptorBase::getLhsRows() {
auto attr = getLhsRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixMultiplyOpGenericAdaptorBase::getLhsColumns() {
auto attr = getLhsColumnsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixMultiplyOpGenericAdaptorBase::getRhsColumns() {
auto attr = getRhsColumnsAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
MatrixMultiplyOpAdaptor::MatrixMultiplyOpAdaptor(MatrixMultiplyOp op) : MatrixMultiplyOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MatrixMultiplyOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_lhs_columns = getProperties().lhs_columns; (void)tblgen_lhs_columns;
if (!tblgen_lhs_columns) return emitError(loc, "'llvm.intr.matrix.multiply' op requires attribute 'lhs_columns'");
auto tblgen_lhs_rows = getProperties().lhs_rows; (void)tblgen_lhs_rows;
if (!tblgen_lhs_rows) return emitError(loc, "'llvm.intr.matrix.multiply' op requires attribute 'lhs_rows'");
auto tblgen_rhs_columns = getProperties().rhs_columns; (void)tblgen_rhs_columns;
if (!tblgen_rhs_columns) return emitError(loc, "'llvm.intr.matrix.multiply' op requires attribute 'rhs_columns'");
if (tblgen_lhs_rows && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_lhs_rows))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_lhs_rows).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.multiply' op attribute 'lhs_rows' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_lhs_columns && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_lhs_columns))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_lhs_columns).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.multiply' op attribute 'lhs_columns' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_rhs_columns && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_rhs_columns))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_rhs_columns).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.multiply' op attribute 'rhs_columns' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult MatrixMultiplyOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.lhs_columns;
auto attr = dict.get("lhs_columns");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `lhs_columns` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.lhs_rows;
auto attr = dict.get("lhs_rows");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `lhs_rows` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.rhs_columns;
auto attr = dict.get("rhs_columns");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `rhs_columns` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MatrixMultiplyOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.lhs_columns;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("lhs_columns",
propStorage));
}
{
const auto &propStorage = prop.lhs_rows;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("lhs_rows",
propStorage));
}
{
const auto &propStorage = prop.rhs_columns;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("rhs_columns",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MatrixMultiplyOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.lhs_columns.getAsOpaquePointer()),
llvm::hash_value(prop.lhs_rows.getAsOpaquePointer()),
llvm::hash_value(prop.rhs_columns.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MatrixMultiplyOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "lhs_columns")
return prop.lhs_columns;
if (name == "lhs_rows")
return prop.lhs_rows;
if (name == "rhs_columns")
return prop.rhs_columns;
return std::nullopt;
}
void MatrixMultiplyOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "lhs_columns") {
prop.lhs_columns = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.lhs_columns)>>(value);
return;
}
if (name == "lhs_rows") {
prop.lhs_rows = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.lhs_rows)>>(value);
return;
}
if (name == "rhs_columns") {
prop.rhs_columns = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.rhs_columns)>>(value);
return;
}
}
void MatrixMultiplyOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.lhs_columns) attrs.append("lhs_columns", prop.lhs_columns);
if (prop.lhs_rows) attrs.append("lhs_rows", prop.lhs_rows);
if (prop.rhs_columns) attrs.append("rhs_columns", prop.rhs_columns);
}
::llvm::LogicalResult MatrixMultiplyOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getLhsColumnsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "lhs_columns", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getLhsRowsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "lhs_rows", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRhsColumnsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "rhs_columns", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixMultiplyOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.lhs_columns)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.lhs_rows)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.rhs_columns)))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixMultiplyOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.lhs_columns);
writer.writeAttribute(prop.lhs_rows);
writer.writeAttribute(prop.rhs_columns);
}
uint32_t MatrixMultiplyOp::getLhsRows() {
auto attr = getLhsRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixMultiplyOp::getLhsColumns() {
auto attr = getLhsColumnsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixMultiplyOp::getRhsColumns() {
auto attr = getRhsColumnsAttr();
return attr.getValue().getZExtValue();
}
void MatrixMultiplyOp::setLhsRows(uint32_t attrValue) {
getProperties().lhs_rows = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixMultiplyOp::setLhsColumns(uint32_t attrValue) {
getProperties().lhs_columns = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixMultiplyOp::setRhsColumns(uint32_t attrValue) {
getProperties().rhs_columns = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixMultiplyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
if (resultType) odsState.addTypes(resultType);
odsState.addOperands(operands);
for (auto namedAttr : attributes)
odsState.addAttribute(namedAttr.getName(), namedAttr.getValue());
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixMultiplyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixMultiplyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::IntegerAttr lhs_rows, ::mlir::IntegerAttr lhs_columns, ::mlir::IntegerAttr rhs_columns) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.getOrAddProperties<Properties>().lhs_rows = lhs_rows;
odsState.getOrAddProperties<Properties>().lhs_columns = lhs_columns;
odsState.getOrAddProperties<Properties>().rhs_columns = rhs_columns;
odsState.addTypes(res);
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::IntegerAttr lhs_rows, ::mlir::IntegerAttr lhs_columns, ::mlir::IntegerAttr rhs_columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
auto __res__ = ::llvm::dyn_cast<MatrixMultiplyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::IntegerAttr lhs_rows, ::mlir::IntegerAttr lhs_columns, ::mlir::IntegerAttr rhs_columns) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
}
void MatrixMultiplyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::IntegerAttr lhs_rows, ::mlir::IntegerAttr lhs_columns, ::mlir::IntegerAttr rhs_columns) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.getOrAddProperties<Properties>().lhs_rows = lhs_rows;
odsState.getOrAddProperties<Properties>().lhs_columns = lhs_columns;
odsState.getOrAddProperties<Properties>().rhs_columns = rhs_columns;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::IntegerAttr lhs_rows, ::mlir::IntegerAttr lhs_columns, ::mlir::IntegerAttr rhs_columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
auto __res__ = ::llvm::dyn_cast<MatrixMultiplyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::IntegerAttr lhs_rows, ::mlir::IntegerAttr lhs_columns, ::mlir::IntegerAttr rhs_columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
}
void MatrixMultiplyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, uint32_t lhs_rows, uint32_t lhs_columns, uint32_t rhs_columns) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.getOrAddProperties<Properties>().lhs_rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), lhs_rows);
odsState.getOrAddProperties<Properties>().lhs_columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), lhs_columns);
odsState.getOrAddProperties<Properties>().rhs_columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rhs_columns);
odsState.addTypes(res);
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, uint32_t lhs_rows, uint32_t lhs_columns, uint32_t rhs_columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
auto __res__ = ::llvm::dyn_cast<MatrixMultiplyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, uint32_t lhs_rows, uint32_t lhs_columns, uint32_t rhs_columns) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
}
void MatrixMultiplyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, uint32_t lhs_rows, uint32_t lhs_columns, uint32_t rhs_columns) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.getOrAddProperties<Properties>().lhs_rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), lhs_rows);
odsState.getOrAddProperties<Properties>().lhs_columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), lhs_columns);
odsState.getOrAddProperties<Properties>().rhs_columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rhs_columns);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, uint32_t lhs_rows, uint32_t lhs_columns, uint32_t rhs_columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
auto __res__ = ::llvm::dyn_cast<MatrixMultiplyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, uint32_t lhs_rows, uint32_t lhs_columns, uint32_t rhs_columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(lhs_rows)>(lhs_rows), std::forward<decltype(lhs_columns)>(lhs_columns), std::forward<decltype(rhs_columns)>(rhs_columns));
}
void MatrixMultiplyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MatrixMultiplyOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixMultiplyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixMultiplyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MatrixMultiplyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixMultiplyOp MatrixMultiplyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MatrixMultiplyOp::verifyInvariantsImpl() {
auto tblgen_lhs_columns = getProperties().lhs_columns; (void)tblgen_lhs_columns;
if (!tblgen_lhs_columns) return emitOpError("requires attribute 'lhs_columns'");
auto tblgen_lhs_rows = getProperties().lhs_rows; (void)tblgen_lhs_rows;
if (!tblgen_lhs_rows) return emitOpError("requires attribute 'lhs_rows'");
auto tblgen_rhs_columns = getProperties().rhs_columns; (void)tblgen_rhs_columns;
if (!tblgen_rhs_columns) return emitOpError("requires attribute 'rhs_columns'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_lhs_rows, "lhs_rows")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_lhs_columns, "lhs_columns")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_rhs_columns, "rhs_columns")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixMultiplyOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult MatrixMultiplyOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand lhsRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(&lhsRawOperand, 1); ::llvm::SMLoc lhsOperandsLoc;
(void)lhsOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand rhsRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(&rhsRawOperand, 1); ::llvm::SMLoc rhsOperandsLoc;
(void)rhsOperandsLoc;
::mlir::Type lhsRawType{};
::llvm::ArrayRef<::mlir::Type> lhsTypes(&lhsRawType, 1);
::mlir::Type rhsRawType{};
::llvm::ArrayRef<::mlir::Type> rhsTypes(&rhsRawType, 1);
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
lhsOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(lhsRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
rhsOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(rhsRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseLParen())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
lhsRawType = type;
}
if (parser.parseComma())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
rhsRawType = type;
}
if (parser.parseRParen())
return ::mlir::failure();
if (parser.parseArrow())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
result.addTypes(resTypes);
if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixMultiplyOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getLhs();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getRhs();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ' << "(";
{
auto type = getLhs().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ",";
_odsPrinter << ' ';
{
auto type = getRhs().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ")";
_odsPrinter << ' ' << "->";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MatrixMultiplyOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MatrixMultiplyOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MatrixTransposeOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MatrixTransposeOpGenericAdaptorBase::MatrixTransposeOpGenericAdaptorBase(MatrixTransposeOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint32_t MatrixTransposeOpGenericAdaptorBase::getRows() {
auto attr = getRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixTransposeOpGenericAdaptorBase::getColumns() {
auto attr = getColumnsAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
MatrixTransposeOpAdaptor::MatrixTransposeOpAdaptor(MatrixTransposeOp op) : MatrixTransposeOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MatrixTransposeOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_columns = getProperties().columns; (void)tblgen_columns;
if (!tblgen_columns) return emitError(loc, "'llvm.intr.matrix.transpose' op requires attribute 'columns'");
auto tblgen_rows = getProperties().rows; (void)tblgen_rows;
if (!tblgen_rows) return emitError(loc, "'llvm.intr.matrix.transpose' op requires attribute 'rows'");
if (tblgen_rows && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_rows))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_rows).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.transpose' op attribute 'rows' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_columns && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_columns))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_columns).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.matrix.transpose' op attribute 'columns' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult MatrixTransposeOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.columns;
auto attr = dict.get("columns");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `columns` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.rows;
auto attr = dict.get("rows");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `rows` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MatrixTransposeOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.columns;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("columns",
propStorage));
}
{
const auto &propStorage = prop.rows;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("rows",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MatrixTransposeOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.columns.getAsOpaquePointer()),
llvm::hash_value(prop.rows.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MatrixTransposeOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "columns")
return prop.columns;
if (name == "rows")
return prop.rows;
return std::nullopt;
}
void MatrixTransposeOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "columns") {
prop.columns = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.columns)>>(value);
return;
}
if (name == "rows") {
prop.rows = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.rows)>>(value);
return;
}
}
void MatrixTransposeOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.columns) attrs.append("columns", prop.columns);
if (prop.rows) attrs.append("rows", prop.rows);
}
::llvm::LogicalResult MatrixTransposeOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getColumnsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "columns", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRowsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "rows", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixTransposeOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.columns)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.rows)))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixTransposeOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.columns);
writer.writeAttribute(prop.rows);
}
uint32_t MatrixTransposeOp::getRows() {
auto attr = getRowsAttr();
return attr.getValue().getZExtValue();
}
uint32_t MatrixTransposeOp::getColumns() {
auto attr = getColumnsAttr();
return attr.getValue().getZExtValue();
}
void MatrixTransposeOp::setRows(uint32_t attrValue) {
getProperties().rows = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixTransposeOp::setColumns(uint32_t attrValue) {
getProperties().columns = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void MatrixTransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
if (resultType) odsState.addTypes(resultType);
odsState.addOperands(operands);
for (auto namedAttr : attributes)
odsState.addAttribute(namedAttr.getName(), namedAttr.getValue());
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixTransposeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixTransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value matrix, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
odsState.addOperands(matrix);
odsState.getOrAddProperties<Properties>().rows = rows;
odsState.getOrAddProperties<Properties>().columns = columns;
odsState.addTypes(res);
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value matrix, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixTransposeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value matrix, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixTransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
odsState.addOperands(matrix);
odsState.getOrAddProperties<Properties>().rows = rows;
odsState.getOrAddProperties<Properties>().columns = columns;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixTransposeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, ::mlir::IntegerAttr rows, ::mlir::IntegerAttr columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixTransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value matrix, uint32_t rows, uint32_t columns) {
odsState.addOperands(matrix);
odsState.getOrAddProperties<Properties>().rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rows);
odsState.getOrAddProperties<Properties>().columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), columns);
odsState.addTypes(res);
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value matrix, uint32_t rows, uint32_t columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixTransposeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value matrix, uint32_t rows, uint32_t columns) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixTransposeOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, uint32_t rows, uint32_t columns) {
odsState.addOperands(matrix);
odsState.getOrAddProperties<Properties>().rows = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rows);
odsState.getOrAddProperties<Properties>().columns = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), columns);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, uint32_t rows, uint32_t columns) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
auto __res__ = ::llvm::dyn_cast<MatrixTransposeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value matrix, uint32_t rows, uint32_t columns) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(matrix)>(matrix), std::forward<decltype(rows)>(rows), std::forward<decltype(columns)>(columns));
}
void MatrixTransposeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MatrixTransposeOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MatrixTransposeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MatrixTransposeOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MatrixTransposeOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MatrixTransposeOp MatrixTransposeOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MatrixTransposeOp::verifyInvariantsImpl() {
auto tblgen_columns = getProperties().columns; (void)tblgen_columns;
if (!tblgen_columns) return emitOpError("requires attribute 'columns'");
auto tblgen_rows = getProperties().rows; (void)tblgen_rows;
if (!tblgen_rows) return emitOpError("requires attribute 'rows'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_rows, "rows")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_columns, "columns")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MatrixTransposeOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult MatrixTransposeOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand matrixRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> matrixOperands(&matrixRawOperand, 1); ::llvm::SMLoc matrixOperandsLoc;
(void)matrixOperandsLoc;
::mlir::Type matrixRawType{};
::llvm::ArrayRef<::mlir::Type> matrixTypes(&matrixRawType, 1);
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
matrixOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(matrixRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
matrixRawType = type;
}
if (parser.parseKeyword("into"))
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
result.addTypes(resTypes);
if (parser.resolveOperands(matrixOperands, matrixTypes, matrixOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MatrixTransposeOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getMatrix();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getMatrix().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "into";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MatrixTransposeOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MatrixTransposeOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MaxNumOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MaxNumOpGenericAdaptorBase::MaxNumOpGenericAdaptorBase(MaxNumOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr MaxNumOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags MaxNumOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
MaxNumOpAdaptor::MaxNumOpAdaptor(MaxNumOp op) : MaxNumOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MaxNumOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.maxnum' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult MaxNumOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MaxNumOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MaxNumOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MaxNumOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void MaxNumOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void MaxNumOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult MaxNumOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MaxNumOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void MaxNumOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags MaxNumOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void MaxNumOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaxNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaxNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaxNumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MaxNumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MaxNumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaxNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaxNumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MaxNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaxNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MaxNumOp MaxNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MaxNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaxNumOp MaxNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MaxNumOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult MaxNumOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MaxNumOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MaxNumOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult MaxNumOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MaxNumOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void MaxNumOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MaxNumOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MaxNumOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MaximumOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MaximumOpGenericAdaptorBase::MaximumOpGenericAdaptorBase(MaximumOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr MaximumOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags MaximumOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
MaximumOpAdaptor::MaximumOpAdaptor(MaximumOp op) : MaximumOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MaximumOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.maximum' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult MaximumOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MaximumOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MaximumOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MaximumOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void MaximumOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void MaximumOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult MaximumOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MaximumOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void MaximumOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags MaximumOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void MaximumOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaximumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaximumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MaximumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MaximumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MaximumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaximumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MaximumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MaximumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MaximumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MaximumOp MaximumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MaximumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MaximumOp MaximumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MaximumOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult MaximumOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MaximumOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MaximumOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult MaximumOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MaximumOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void MaximumOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MaximumOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MaximumOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MemcpyInlineOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MemcpyInlineOpGenericAdaptorBase::MemcpyInlineOpGenericAdaptorBase(MemcpyInlineOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::APInt MemcpyInlineOpGenericAdaptorBase::getLen() {
auto attr = getLenAttr();
return attr.getValue();
}
bool MemcpyInlineOpGenericAdaptorBase::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOpGenericAdaptorBase::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOpGenericAdaptorBase::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOpGenericAdaptorBase::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOpGenericAdaptorBase::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOpGenericAdaptorBase::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOpGenericAdaptorBase::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
MemcpyInlineOpAdaptor::MemcpyInlineOpAdaptor(MemcpyInlineOp op) : MemcpyInlineOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MemcpyInlineOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitError(loc, "'llvm.intr.memcpy.inline' op requires attribute 'isVolatile'");
auto tblgen_len = getProperties().len; (void)tblgen_len;
if (!tblgen_len) return emitError(loc, "'llvm.intr.memcpy.inline' op requires attribute 'len'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (tblgen_len && !((::llvm::isa<::mlir::IntegerAttr>(tblgen_len))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'len' failed to satisfy constraint: arbitrary integer attribute");
if (tblgen_isVolatile && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_isVolatile))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_isVolatile).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'isVolatile' failed to satisfy constraint: 1-bit signless integer attribute");
if (tblgen_access_groups && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_access_groups))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_access_groups), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AccessGroupAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'access_groups' failed to satisfy constraint: LLVM dialect access group metadata array");
if (tblgen_alias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_alias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_alias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'alias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_noalias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_noalias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_noalias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'noalias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_tbaa && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_tbaa))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_tbaa), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::TBAATagAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'tbaa' failed to satisfy constraint: LLVM dialect TBAA tag metadata array");
if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy.inline' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
return ::mlir::success();
}
::llvm::LogicalResult MemcpyInlineOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.access_groups;
auto attr = dict.get("access_groups");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto attr = dict.get("alias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto attr = dict.get("arg_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto attr = dict.get("isVolatile");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.len;
auto attr = dict.get("len");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `len` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto attr = dict.get("noalias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto attr = dict.get("res_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto attr = dict.get("tbaa");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MemcpyInlineOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.access_groups;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("access_groups",
propStorage));
}
{
const auto &propStorage = prop.alias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alias_scopes",
propStorage));
}
{
const auto &propStorage = prop.arg_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
propStorage));
}
{
const auto &propStorage = prop.isVolatile;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("isVolatile",
propStorage));
}
{
const auto &propStorage = prop.len;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("len",
propStorage));
}
{
const auto &propStorage = prop.noalias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("noalias_scopes",
propStorage));
}
{
const auto &propStorage = prop.res_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
propStorage));
}
{
const auto &propStorage = prop.tbaa;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("tbaa",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MemcpyInlineOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.access_groups.getAsOpaquePointer()),
llvm::hash_value(prop.alias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.isVolatile.getAsOpaquePointer()),
llvm::hash_value(prop.len.getAsOpaquePointer()),
llvm::hash_value(prop.noalias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.res_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.tbaa.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MemcpyInlineOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "access_groups")
return prop.access_groups;
if (name == "alias_scopes")
return prop.alias_scopes;
if (name == "arg_attrs")
return prop.arg_attrs;
if (name == "isVolatile")
return prop.isVolatile;
if (name == "len")
return prop.len;
if (name == "noalias_scopes")
return prop.noalias_scopes;
if (name == "res_attrs")
return prop.res_attrs;
if (name == "tbaa")
return prop.tbaa;
return std::nullopt;
}
void MemcpyInlineOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "access_groups") {
prop.access_groups = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.access_groups)>>(value);
return;
}
if (name == "alias_scopes") {
prop.alias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alias_scopes)>>(value);
return;
}
if (name == "arg_attrs") {
prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
return;
}
if (name == "isVolatile") {
prop.isVolatile = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.isVolatile)>>(value);
return;
}
if (name == "len") {
prop.len = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.len)>>(value);
return;
}
if (name == "noalias_scopes") {
prop.noalias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.noalias_scopes)>>(value);
return;
}
if (name == "res_attrs") {
prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
return;
}
if (name == "tbaa") {
prop.tbaa = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.tbaa)>>(value);
return;
}
}
void MemcpyInlineOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.access_groups) attrs.append("access_groups", prop.access_groups);
if (prop.alias_scopes) attrs.append("alias_scopes", prop.alias_scopes);
if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
if (prop.isVolatile) attrs.append("isVolatile", prop.isVolatile);
if (prop.len) attrs.append("len", prop.len);
if (prop.noalias_scopes) attrs.append("noalias_scopes", prop.noalias_scopes);
if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
if (prop.tbaa) attrs.append("tbaa", prop.tbaa);
}
::llvm::LogicalResult MemcpyInlineOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAccessGroupsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(attr, "access_groups", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getAliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "alias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "arg_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getIsVolatileAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "isVolatile", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getLenAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps14(attr, "len", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getNoaliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "noalias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "res_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getTbaaAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(attr, "tbaa", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MemcpyInlineOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.access_groups)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.alias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.isVolatile)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.len)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.noalias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.tbaa)))
return ::mlir::failure();
return ::mlir::success();
}
void MemcpyInlineOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.access_groups);
writer.writeOptionalAttribute(prop.alias_scopes);
writer.writeOptionalAttribute(prop.arg_attrs);
writer.writeAttribute(prop.isVolatile);
writer.writeAttribute(prop.len);
writer.writeOptionalAttribute(prop.noalias_scopes);
writer.writeOptionalAttribute(prop.res_attrs);
writer.writeOptionalAttribute(prop.tbaa);
}
::mlir::APInt MemcpyInlineOp::getLen() {
auto attr = getLenAttr();
return attr.getValue();
}
bool MemcpyInlineOp::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOp::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOp::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOp::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOp::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOp::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyInlineOp::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
void MemcpyInlineOp::setIsVolatile(bool attrValue) {
getProperties().isVolatile = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void MemcpyInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value src, IntegerAttr len, bool isVolatile) {
build(odsBuilder, odsState, dst, src, len,
odsBuilder.getBoolAttr(isVolatile));
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value src, IntegerAttr len, bool isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value src, IntegerAttr len, bool isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemcpyInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value src, IntegerAttr len, IntegerAttr isVolatile) {
build(odsBuilder, odsState, dst, src, len, isVolatile,
/*access_groups=*/nullptr, /*alias_scopes=*/nullptr,
/*noalias_scopes=*/nullptr, /*tbaa=*/nullptr,
/*arg_attrs=*/nullptr, /*res_attrs=*/nullptr);
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value src, IntegerAttr len, IntegerAttr isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value src, IntegerAttr len, IntegerAttr isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemcpyInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyInlineOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MemcpyInlineOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MemcpyInlineOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MemcpyInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyInlineOp MemcpyInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MemcpyInlineOp::verifyInvariantsImpl() {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitOpError("requires attribute 'isVolatile'");
auto tblgen_len = getProperties().len; (void)tblgen_len;
if (!tblgen_len) return emitOpError("requires attribute 'len'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps14(*this, tblgen_len, "len")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_isVolatile, "isVolatile")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(*this, tblgen_access_groups, "access_groups")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_alias_scopes, "alias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_noalias_scopes, "noalias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(*this, tblgen_tbaa, "tbaa")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_arg_attrs, "arg_attrs")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_res_attrs, "res_attrs")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MemcpyInlineOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MemcpyInlineOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.len;
auto lenAttrName = ::mlir::StringAttr::get(ctx, "len");
auto attr = dict.get(lenAttrName);
usedKeys.insert(lenAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for len in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `len` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto isVolatileAttrName = ::mlir::StringAttr::get(ctx, "isVolatile");
auto attr = dict.get(isVolatileAttrName);
usedKeys.insert(isVolatileAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for isVolatile in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.access_groups;
auto access_groupsAttrName = ::mlir::StringAttr::get(ctx, "access_groups");
auto attr = dict.get(access_groupsAttrName);
usedKeys.insert(access_groupsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for access_groups in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto alias_scopesAttrName = ::mlir::StringAttr::get(ctx, "alias_scopes");
auto attr = dict.get(alias_scopesAttrName);
usedKeys.insert(alias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for alias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto noalias_scopesAttrName = ::mlir::StringAttr::get(ctx, "noalias_scopes");
auto attr = dict.get(noalias_scopesAttrName);
usedKeys.insert(noalias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for noalias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto tbaaAttrName = ::mlir::StringAttr::get(ctx, "tbaa");
auto attr = dict.get(tbaaAttrName);
usedKeys.insert(tbaaAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for tbaa in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx, "arg_attrs");
auto attr = dict.get(arg_attrsAttrName);
usedKeys.insert(arg_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for arg_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto res_attrsAttrName = ::mlir::StringAttr::get(ctx, "res_attrs");
auto attr = dict.get(res_attrsAttrName);
usedKeys.insert(res_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for res_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void MemcpyInlineOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
{
auto valueRange = getODSOperandIndexAndLength(0);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Write::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
{
auto valueRange = getODSOperandIndexAndLength(1);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Read::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MemcpyInlineOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MemcpyInlineOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MemcpyOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MemcpyOpGenericAdaptorBase::MemcpyOpGenericAdaptorBase(MemcpyOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool MemcpyOpGenericAdaptorBase::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemcpyOpGenericAdaptorBase::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOpGenericAdaptorBase::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOpGenericAdaptorBase::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOpGenericAdaptorBase::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOpGenericAdaptorBase::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOpGenericAdaptorBase::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
MemcpyOpAdaptor::MemcpyOpAdaptor(MemcpyOp op) : MemcpyOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MemcpyOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitError(loc, "'llvm.intr.memcpy' op requires attribute 'isVolatile'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (tblgen_isVolatile && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_isVolatile))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_isVolatile).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.memcpy' op attribute 'isVolatile' failed to satisfy constraint: 1-bit signless integer attribute");
if (tblgen_access_groups && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_access_groups))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_access_groups), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AccessGroupAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy' op attribute 'access_groups' failed to satisfy constraint: LLVM dialect access group metadata array");
if (tblgen_alias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_alias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_alias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy' op attribute 'alias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_noalias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_noalias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_noalias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy' op attribute 'noalias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_tbaa && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_tbaa))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_tbaa), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::TBAATagAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy' op attribute 'tbaa' failed to satisfy constraint: LLVM dialect TBAA tag metadata array");
if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memcpy' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
return ::mlir::success();
}
::llvm::LogicalResult MemcpyOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.access_groups;
auto attr = dict.get("access_groups");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto attr = dict.get("alias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto attr = dict.get("arg_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto attr = dict.get("isVolatile");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto attr = dict.get("noalias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto attr = dict.get("res_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto attr = dict.get("tbaa");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MemcpyOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.access_groups;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("access_groups",
propStorage));
}
{
const auto &propStorage = prop.alias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alias_scopes",
propStorage));
}
{
const auto &propStorage = prop.arg_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
propStorage));
}
{
const auto &propStorage = prop.isVolatile;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("isVolatile",
propStorage));
}
{
const auto &propStorage = prop.noalias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("noalias_scopes",
propStorage));
}
{
const auto &propStorage = prop.res_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
propStorage));
}
{
const auto &propStorage = prop.tbaa;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("tbaa",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MemcpyOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.access_groups.getAsOpaquePointer()),
llvm::hash_value(prop.alias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.isVolatile.getAsOpaquePointer()),
llvm::hash_value(prop.noalias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.res_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.tbaa.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MemcpyOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "access_groups")
return prop.access_groups;
if (name == "alias_scopes")
return prop.alias_scopes;
if (name == "arg_attrs")
return prop.arg_attrs;
if (name == "isVolatile")
return prop.isVolatile;
if (name == "noalias_scopes")
return prop.noalias_scopes;
if (name == "res_attrs")
return prop.res_attrs;
if (name == "tbaa")
return prop.tbaa;
return std::nullopt;
}
void MemcpyOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "access_groups") {
prop.access_groups = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.access_groups)>>(value);
return;
}
if (name == "alias_scopes") {
prop.alias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alias_scopes)>>(value);
return;
}
if (name == "arg_attrs") {
prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
return;
}
if (name == "isVolatile") {
prop.isVolatile = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.isVolatile)>>(value);
return;
}
if (name == "noalias_scopes") {
prop.noalias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.noalias_scopes)>>(value);
return;
}
if (name == "res_attrs") {
prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
return;
}
if (name == "tbaa") {
prop.tbaa = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.tbaa)>>(value);
return;
}
}
void MemcpyOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.access_groups) attrs.append("access_groups", prop.access_groups);
if (prop.alias_scopes) attrs.append("alias_scopes", prop.alias_scopes);
if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
if (prop.isVolatile) attrs.append("isVolatile", prop.isVolatile);
if (prop.noalias_scopes) attrs.append("noalias_scopes", prop.noalias_scopes);
if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
if (prop.tbaa) attrs.append("tbaa", prop.tbaa);
}
::llvm::LogicalResult MemcpyOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAccessGroupsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(attr, "access_groups", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getAliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "alias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "arg_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getIsVolatileAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "isVolatile", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getNoaliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "noalias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "res_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getTbaaAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(attr, "tbaa", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MemcpyOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.access_groups)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.alias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.isVolatile)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.noalias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.tbaa)))
return ::mlir::failure();
return ::mlir::success();
}
void MemcpyOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.access_groups);
writer.writeOptionalAttribute(prop.alias_scopes);
writer.writeOptionalAttribute(prop.arg_attrs);
writer.writeAttribute(prop.isVolatile);
writer.writeOptionalAttribute(prop.noalias_scopes);
writer.writeOptionalAttribute(prop.res_attrs);
writer.writeOptionalAttribute(prop.tbaa);
}
bool MemcpyOp::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemcpyOp::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOp::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOp::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOp::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOp::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemcpyOp::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
void MemcpyOp::setIsVolatile(bool attrValue) {
getProperties().isVolatile = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void MemcpyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value src, Value len, bool isVolatile) {
build(odsBuilder, odsState, dst, src, len,
odsBuilder.getBoolAttr(isVolatile));
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value src, Value len, bool isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value src, Value len, bool isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemcpyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value src, Value len, IntegerAttr isVolatile) {
build(odsBuilder, odsState, dst, src, len, isVolatile,
/*access_groups=*/nullptr, /*alias_scopes=*/nullptr,
/*noalias_scopes=*/nullptr, /*tbaa=*/nullptr,
/*arg_attrs=*/nullptr, /*res_attrs=*/nullptr);
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value src, Value len, IntegerAttr isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value src, Value len, IntegerAttr isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemcpyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemcpyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MemcpyOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MemcpyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MemcpyOp MemcpyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MemcpyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemcpyOp MemcpyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MemcpyOp::verifyInvariantsImpl() {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitOpError("requires attribute 'isVolatile'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_isVolatile, "isVolatile")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(*this, tblgen_access_groups, "access_groups")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_alias_scopes, "alias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_noalias_scopes, "noalias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(*this, tblgen_tbaa, "tbaa")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_arg_attrs, "arg_attrs")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_res_attrs, "res_attrs")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MemcpyOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MemcpyOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.isVolatile;
auto isVolatileAttrName = ::mlir::StringAttr::get(ctx, "isVolatile");
auto attr = dict.get(isVolatileAttrName);
usedKeys.insert(isVolatileAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for isVolatile in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.access_groups;
auto access_groupsAttrName = ::mlir::StringAttr::get(ctx, "access_groups");
auto attr = dict.get(access_groupsAttrName);
usedKeys.insert(access_groupsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for access_groups in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto alias_scopesAttrName = ::mlir::StringAttr::get(ctx, "alias_scopes");
auto attr = dict.get(alias_scopesAttrName);
usedKeys.insert(alias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for alias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto noalias_scopesAttrName = ::mlir::StringAttr::get(ctx, "noalias_scopes");
auto attr = dict.get(noalias_scopesAttrName);
usedKeys.insert(noalias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for noalias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto tbaaAttrName = ::mlir::StringAttr::get(ctx, "tbaa");
auto attr = dict.get(tbaaAttrName);
usedKeys.insert(tbaaAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for tbaa in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx, "arg_attrs");
auto attr = dict.get(arg_attrsAttrName);
usedKeys.insert(arg_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for arg_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto res_attrsAttrName = ::mlir::StringAttr::get(ctx, "res_attrs");
auto attr = dict.get(res_attrsAttrName);
usedKeys.insert(res_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for res_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void MemcpyOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
{
auto valueRange = getODSOperandIndexAndLength(0);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Write::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
{
auto valueRange = getODSOperandIndexAndLength(1);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Read::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MemcpyOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MemcpyOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MemmoveOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MemmoveOpGenericAdaptorBase::MemmoveOpGenericAdaptorBase(MemmoveOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool MemmoveOpGenericAdaptorBase::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemmoveOpGenericAdaptorBase::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOpGenericAdaptorBase::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOpGenericAdaptorBase::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOpGenericAdaptorBase::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOpGenericAdaptorBase::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOpGenericAdaptorBase::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
MemmoveOpAdaptor::MemmoveOpAdaptor(MemmoveOp op) : MemmoveOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MemmoveOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitError(loc, "'llvm.intr.memmove' op requires attribute 'isVolatile'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (tblgen_isVolatile && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_isVolatile))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_isVolatile).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.memmove' op attribute 'isVolatile' failed to satisfy constraint: 1-bit signless integer attribute");
if (tblgen_access_groups && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_access_groups))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_access_groups), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AccessGroupAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memmove' op attribute 'access_groups' failed to satisfy constraint: LLVM dialect access group metadata array");
if (tblgen_alias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_alias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_alias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memmove' op attribute 'alias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_noalias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_noalias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_noalias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memmove' op attribute 'noalias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_tbaa && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_tbaa))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_tbaa), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::TBAATagAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memmove' op attribute 'tbaa' failed to satisfy constraint: LLVM dialect TBAA tag metadata array");
if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memmove' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memmove' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
return ::mlir::success();
}
::llvm::LogicalResult MemmoveOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.access_groups;
auto attr = dict.get("access_groups");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto attr = dict.get("alias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto attr = dict.get("arg_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto attr = dict.get("isVolatile");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto attr = dict.get("noalias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto attr = dict.get("res_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto attr = dict.get("tbaa");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MemmoveOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.access_groups;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("access_groups",
propStorage));
}
{
const auto &propStorage = prop.alias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alias_scopes",
propStorage));
}
{
const auto &propStorage = prop.arg_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
propStorage));
}
{
const auto &propStorage = prop.isVolatile;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("isVolatile",
propStorage));
}
{
const auto &propStorage = prop.noalias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("noalias_scopes",
propStorage));
}
{
const auto &propStorage = prop.res_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
propStorage));
}
{
const auto &propStorage = prop.tbaa;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("tbaa",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MemmoveOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.access_groups.getAsOpaquePointer()),
llvm::hash_value(prop.alias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.isVolatile.getAsOpaquePointer()),
llvm::hash_value(prop.noalias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.res_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.tbaa.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MemmoveOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "access_groups")
return prop.access_groups;
if (name == "alias_scopes")
return prop.alias_scopes;
if (name == "arg_attrs")
return prop.arg_attrs;
if (name == "isVolatile")
return prop.isVolatile;
if (name == "noalias_scopes")
return prop.noalias_scopes;
if (name == "res_attrs")
return prop.res_attrs;
if (name == "tbaa")
return prop.tbaa;
return std::nullopt;
}
void MemmoveOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "access_groups") {
prop.access_groups = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.access_groups)>>(value);
return;
}
if (name == "alias_scopes") {
prop.alias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alias_scopes)>>(value);
return;
}
if (name == "arg_attrs") {
prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
return;
}
if (name == "isVolatile") {
prop.isVolatile = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.isVolatile)>>(value);
return;
}
if (name == "noalias_scopes") {
prop.noalias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.noalias_scopes)>>(value);
return;
}
if (name == "res_attrs") {
prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
return;
}
if (name == "tbaa") {
prop.tbaa = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.tbaa)>>(value);
return;
}
}
void MemmoveOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.access_groups) attrs.append("access_groups", prop.access_groups);
if (prop.alias_scopes) attrs.append("alias_scopes", prop.alias_scopes);
if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
if (prop.isVolatile) attrs.append("isVolatile", prop.isVolatile);
if (prop.noalias_scopes) attrs.append("noalias_scopes", prop.noalias_scopes);
if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
if (prop.tbaa) attrs.append("tbaa", prop.tbaa);
}
::llvm::LogicalResult MemmoveOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAccessGroupsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(attr, "access_groups", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getAliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "alias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "arg_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getIsVolatileAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "isVolatile", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getNoaliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "noalias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "res_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getTbaaAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(attr, "tbaa", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MemmoveOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.access_groups)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.alias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.isVolatile)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.noalias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.tbaa)))
return ::mlir::failure();
return ::mlir::success();
}
void MemmoveOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.access_groups);
writer.writeOptionalAttribute(prop.alias_scopes);
writer.writeOptionalAttribute(prop.arg_attrs);
writer.writeAttribute(prop.isVolatile);
writer.writeOptionalAttribute(prop.noalias_scopes);
writer.writeOptionalAttribute(prop.res_attrs);
writer.writeOptionalAttribute(prop.tbaa);
}
bool MemmoveOp::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemmoveOp::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOp::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOp::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOp::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOp::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemmoveOp::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
void MemmoveOp::setIsVolatile(bool attrValue) {
getProperties().isVolatile = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void MemmoveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value src, Value len, bool isVolatile) {
build(odsBuilder, odsState, dst, src, len,
odsBuilder.getBoolAttr(isVolatile));
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value src, Value len, bool isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value src, Value len, bool isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemmoveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value src, Value len, IntegerAttr isVolatile) {
build(odsBuilder, odsState, dst, src, len, isVolatile,
/*access_groups=*/nullptr, /*alias_scopes=*/nullptr,
/*noalias_scopes=*/nullptr, /*tbaa=*/nullptr,
/*arg_attrs=*/nullptr, /*res_attrs=*/nullptr);
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value src, Value len, IntegerAttr isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value src, Value len, IntegerAttr isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemmoveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemmoveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemmoveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemmoveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(src);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value src, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(src)>(src), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemmoveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MemmoveOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MemmoveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MemmoveOp MemmoveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MemmoveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemmoveOp MemmoveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MemmoveOp::verifyInvariantsImpl() {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitOpError("requires attribute 'isVolatile'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_isVolatile, "isVolatile")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(*this, tblgen_access_groups, "access_groups")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_alias_scopes, "alias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_noalias_scopes, "noalias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(*this, tblgen_tbaa, "tbaa")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_arg_attrs, "arg_attrs")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_res_attrs, "res_attrs")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MemmoveOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MemmoveOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.isVolatile;
auto isVolatileAttrName = ::mlir::StringAttr::get(ctx, "isVolatile");
auto attr = dict.get(isVolatileAttrName);
usedKeys.insert(isVolatileAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for isVolatile in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.access_groups;
auto access_groupsAttrName = ::mlir::StringAttr::get(ctx, "access_groups");
auto attr = dict.get(access_groupsAttrName);
usedKeys.insert(access_groupsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for access_groups in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto alias_scopesAttrName = ::mlir::StringAttr::get(ctx, "alias_scopes");
auto attr = dict.get(alias_scopesAttrName);
usedKeys.insert(alias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for alias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto noalias_scopesAttrName = ::mlir::StringAttr::get(ctx, "noalias_scopes");
auto attr = dict.get(noalias_scopesAttrName);
usedKeys.insert(noalias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for noalias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto tbaaAttrName = ::mlir::StringAttr::get(ctx, "tbaa");
auto attr = dict.get(tbaaAttrName);
usedKeys.insert(tbaaAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for tbaa in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx, "arg_attrs");
auto attr = dict.get(arg_attrsAttrName);
usedKeys.insert(arg_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for arg_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto res_attrsAttrName = ::mlir::StringAttr::get(ctx, "res_attrs");
auto attr = dict.get(res_attrsAttrName);
usedKeys.insert(res_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for res_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void MemmoveOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
{
auto valueRange = getODSOperandIndexAndLength(0);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Write::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
{
auto valueRange = getODSOperandIndexAndLength(1);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Read::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MemmoveOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MemmoveOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MemsetInlineOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MemsetInlineOpGenericAdaptorBase::MemsetInlineOpGenericAdaptorBase(MemsetInlineOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::APInt MemsetInlineOpGenericAdaptorBase::getLen() {
auto attr = getLenAttr();
return attr.getValue();
}
bool MemsetInlineOpGenericAdaptorBase::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOpGenericAdaptorBase::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOpGenericAdaptorBase::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOpGenericAdaptorBase::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOpGenericAdaptorBase::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOpGenericAdaptorBase::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOpGenericAdaptorBase::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
MemsetInlineOpAdaptor::MemsetInlineOpAdaptor(MemsetInlineOp op) : MemsetInlineOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MemsetInlineOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitError(loc, "'llvm.intr.memset.inline' op requires attribute 'isVolatile'");
auto tblgen_len = getProperties().len; (void)tblgen_len;
if (!tblgen_len) return emitError(loc, "'llvm.intr.memset.inline' op requires attribute 'len'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (tblgen_len && !((::llvm::isa<::mlir::IntegerAttr>(tblgen_len))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'len' failed to satisfy constraint: arbitrary integer attribute");
if (tblgen_isVolatile && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_isVolatile))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_isVolatile).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'isVolatile' failed to satisfy constraint: 1-bit signless integer attribute");
if (tblgen_access_groups && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_access_groups))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_access_groups), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AccessGroupAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'access_groups' failed to satisfy constraint: LLVM dialect access group metadata array");
if (tblgen_alias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_alias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_alias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'alias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_noalias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_noalias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_noalias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'noalias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_tbaa && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_tbaa))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_tbaa), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::TBAATagAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'tbaa' failed to satisfy constraint: LLVM dialect TBAA tag metadata array");
if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset.inline' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
return ::mlir::success();
}
::llvm::LogicalResult MemsetInlineOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.access_groups;
auto attr = dict.get("access_groups");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto attr = dict.get("alias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto attr = dict.get("arg_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto attr = dict.get("isVolatile");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.len;
auto attr = dict.get("len");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `len` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto attr = dict.get("noalias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto attr = dict.get("res_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto attr = dict.get("tbaa");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MemsetInlineOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.access_groups;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("access_groups",
propStorage));
}
{
const auto &propStorage = prop.alias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alias_scopes",
propStorage));
}
{
const auto &propStorage = prop.arg_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
propStorage));
}
{
const auto &propStorage = prop.isVolatile;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("isVolatile",
propStorage));
}
{
const auto &propStorage = prop.len;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("len",
propStorage));
}
{
const auto &propStorage = prop.noalias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("noalias_scopes",
propStorage));
}
{
const auto &propStorage = prop.res_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
propStorage));
}
{
const auto &propStorage = prop.tbaa;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("tbaa",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MemsetInlineOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.access_groups.getAsOpaquePointer()),
llvm::hash_value(prop.alias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.isVolatile.getAsOpaquePointer()),
llvm::hash_value(prop.len.getAsOpaquePointer()),
llvm::hash_value(prop.noalias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.res_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.tbaa.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MemsetInlineOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "access_groups")
return prop.access_groups;
if (name == "alias_scopes")
return prop.alias_scopes;
if (name == "arg_attrs")
return prop.arg_attrs;
if (name == "isVolatile")
return prop.isVolatile;
if (name == "len")
return prop.len;
if (name == "noalias_scopes")
return prop.noalias_scopes;
if (name == "res_attrs")
return prop.res_attrs;
if (name == "tbaa")
return prop.tbaa;
return std::nullopt;
}
void MemsetInlineOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "access_groups") {
prop.access_groups = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.access_groups)>>(value);
return;
}
if (name == "alias_scopes") {
prop.alias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alias_scopes)>>(value);
return;
}
if (name == "arg_attrs") {
prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
return;
}
if (name == "isVolatile") {
prop.isVolatile = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.isVolatile)>>(value);
return;
}
if (name == "len") {
prop.len = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.len)>>(value);
return;
}
if (name == "noalias_scopes") {
prop.noalias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.noalias_scopes)>>(value);
return;
}
if (name == "res_attrs") {
prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
return;
}
if (name == "tbaa") {
prop.tbaa = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.tbaa)>>(value);
return;
}
}
void MemsetInlineOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.access_groups) attrs.append("access_groups", prop.access_groups);
if (prop.alias_scopes) attrs.append("alias_scopes", prop.alias_scopes);
if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
if (prop.isVolatile) attrs.append("isVolatile", prop.isVolatile);
if (prop.len) attrs.append("len", prop.len);
if (prop.noalias_scopes) attrs.append("noalias_scopes", prop.noalias_scopes);
if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
if (prop.tbaa) attrs.append("tbaa", prop.tbaa);
}
::llvm::LogicalResult MemsetInlineOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAccessGroupsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(attr, "access_groups", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getAliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "alias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "arg_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getIsVolatileAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "isVolatile", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getLenAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps14(attr, "len", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getNoaliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "noalias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "res_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getTbaaAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(attr, "tbaa", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MemsetInlineOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.access_groups)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.alias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.isVolatile)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.len)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.noalias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.tbaa)))
return ::mlir::failure();
return ::mlir::success();
}
void MemsetInlineOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.access_groups);
writer.writeOptionalAttribute(prop.alias_scopes);
writer.writeOptionalAttribute(prop.arg_attrs);
writer.writeAttribute(prop.isVolatile);
writer.writeAttribute(prop.len);
writer.writeOptionalAttribute(prop.noalias_scopes);
writer.writeOptionalAttribute(prop.res_attrs);
writer.writeOptionalAttribute(prop.tbaa);
}
::mlir::APInt MemsetInlineOp::getLen() {
auto attr = getLenAttr();
return attr.getValue();
}
bool MemsetInlineOp::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOp::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOp::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOp::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOp::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOp::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetInlineOp::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
void MemsetInlineOp::setIsVolatile(bool attrValue) {
getProperties().isVolatile = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void MemsetInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value val, IntegerAttr len, bool isVolatile) {
build(odsBuilder, odsState, dst, val, len,
odsBuilder.getBoolAttr(isVolatile));
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value val, IntegerAttr len, bool isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value val, IntegerAttr len, bool isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemsetInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value val, IntegerAttr len, IntegerAttr isVolatile) {
build(odsBuilder, odsState, dst, val, len, isVolatile,
/*access_groups=*/nullptr, /*alias_scopes=*/nullptr,
/*noalias_scopes=*/nullptr, /*tbaa=*/nullptr,
/*arg_attrs=*/nullptr, /*res_attrs=*/nullptr);
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value val, IntegerAttr len, IntegerAttr isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value val, IntegerAttr len, IntegerAttr isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemsetInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetInlineOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().len = len;
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::IntegerAttr len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetInlineOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MemsetInlineOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MemsetInlineOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MemsetInlineOp MemsetInlineOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MemsetInlineOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetInlineOp MemsetInlineOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MemsetInlineOp::verifyInvariantsImpl() {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitOpError("requires attribute 'isVolatile'");
auto tblgen_len = getProperties().len; (void)tblgen_len;
if (!tblgen_len) return emitOpError("requires attribute 'len'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps14(*this, tblgen_len, "len")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_isVolatile, "isVolatile")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(*this, tblgen_access_groups, "access_groups")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_alias_scopes, "alias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_noalias_scopes, "noalias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(*this, tblgen_tbaa, "tbaa")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_arg_attrs, "arg_attrs")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_res_attrs, "res_attrs")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps14(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MemsetInlineOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MemsetInlineOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.len;
auto lenAttrName = ::mlir::StringAttr::get(ctx, "len");
auto attr = dict.get(lenAttrName);
usedKeys.insert(lenAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for len in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `len` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto isVolatileAttrName = ::mlir::StringAttr::get(ctx, "isVolatile");
auto attr = dict.get(isVolatileAttrName);
usedKeys.insert(isVolatileAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for isVolatile in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.access_groups;
auto access_groupsAttrName = ::mlir::StringAttr::get(ctx, "access_groups");
auto attr = dict.get(access_groupsAttrName);
usedKeys.insert(access_groupsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for access_groups in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto alias_scopesAttrName = ::mlir::StringAttr::get(ctx, "alias_scopes");
auto attr = dict.get(alias_scopesAttrName);
usedKeys.insert(alias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for alias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto noalias_scopesAttrName = ::mlir::StringAttr::get(ctx, "noalias_scopes");
auto attr = dict.get(noalias_scopesAttrName);
usedKeys.insert(noalias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for noalias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto tbaaAttrName = ::mlir::StringAttr::get(ctx, "tbaa");
auto attr = dict.get(tbaaAttrName);
usedKeys.insert(tbaaAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for tbaa in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx, "arg_attrs");
auto attr = dict.get(arg_attrsAttrName);
usedKeys.insert(arg_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for arg_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto res_attrsAttrName = ::mlir::StringAttr::get(ctx, "res_attrs");
auto attr = dict.get(res_attrsAttrName);
usedKeys.insert(res_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for res_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void MemsetInlineOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
{
auto valueRange = getODSOperandIndexAndLength(0);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Write::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MemsetInlineOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MemsetInlineOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MemsetOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MemsetOpGenericAdaptorBase::MemsetOpGenericAdaptorBase(MemsetOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
bool MemsetOpGenericAdaptorBase::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemsetOpGenericAdaptorBase::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOpGenericAdaptorBase::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOpGenericAdaptorBase::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOpGenericAdaptorBase::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOpGenericAdaptorBase::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOpGenericAdaptorBase::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
MemsetOpAdaptor::MemsetOpAdaptor(MemsetOp op) : MemsetOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MemsetOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitError(loc, "'llvm.intr.memset' op requires attribute 'isVolatile'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (tblgen_isVolatile && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_isVolatile))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_isVolatile).getType().isSignlessInteger(1)))))
return emitError(loc, "'llvm.intr.memset' op attribute 'isVolatile' failed to satisfy constraint: 1-bit signless integer attribute");
if (tblgen_access_groups && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_access_groups))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_access_groups), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AccessGroupAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset' op attribute 'access_groups' failed to satisfy constraint: LLVM dialect access group metadata array");
if (tblgen_alias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_alias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_alias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset' op attribute 'alias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_noalias_scopes && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_noalias_scopes))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_noalias_scopes), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset' op attribute 'noalias_scopes' failed to satisfy constraint: LLVM dialect alias scope array");
if (tblgen_tbaa && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_tbaa))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_tbaa), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::LLVM::TBAATagAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset' op attribute 'tbaa' failed to satisfy constraint: LLVM dialect TBAA tag metadata array");
if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.memset' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
return ::mlir::success();
}
::llvm::LogicalResult MemsetOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.access_groups;
auto attr = dict.get("access_groups");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto attr = dict.get("alias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto attr = dict.get("arg_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.isVolatile;
auto attr = dict.get("isVolatile");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto attr = dict.get("noalias_scopes");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto attr = dict.get("res_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto attr = dict.get("tbaa");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MemsetOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.access_groups;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("access_groups",
propStorage));
}
{
const auto &propStorage = prop.alias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alias_scopes",
propStorage));
}
{
const auto &propStorage = prop.arg_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
propStorage));
}
{
const auto &propStorage = prop.isVolatile;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("isVolatile",
propStorage));
}
{
const auto &propStorage = prop.noalias_scopes;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("noalias_scopes",
propStorage));
}
{
const auto &propStorage = prop.res_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
propStorage));
}
{
const auto &propStorage = prop.tbaa;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("tbaa",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MemsetOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.access_groups.getAsOpaquePointer()),
llvm::hash_value(prop.alias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.isVolatile.getAsOpaquePointer()),
llvm::hash_value(prop.noalias_scopes.getAsOpaquePointer()),
llvm::hash_value(prop.res_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.tbaa.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MemsetOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "access_groups")
return prop.access_groups;
if (name == "alias_scopes")
return prop.alias_scopes;
if (name == "arg_attrs")
return prop.arg_attrs;
if (name == "isVolatile")
return prop.isVolatile;
if (name == "noalias_scopes")
return prop.noalias_scopes;
if (name == "res_attrs")
return prop.res_attrs;
if (name == "tbaa")
return prop.tbaa;
return std::nullopt;
}
void MemsetOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "access_groups") {
prop.access_groups = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.access_groups)>>(value);
return;
}
if (name == "alias_scopes") {
prop.alias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alias_scopes)>>(value);
return;
}
if (name == "arg_attrs") {
prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
return;
}
if (name == "isVolatile") {
prop.isVolatile = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.isVolatile)>>(value);
return;
}
if (name == "noalias_scopes") {
prop.noalias_scopes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.noalias_scopes)>>(value);
return;
}
if (name == "res_attrs") {
prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
return;
}
if (name == "tbaa") {
prop.tbaa = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.tbaa)>>(value);
return;
}
}
void MemsetOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.access_groups) attrs.append("access_groups", prop.access_groups);
if (prop.alias_scopes) attrs.append("alias_scopes", prop.alias_scopes);
if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
if (prop.isVolatile) attrs.append("isVolatile", prop.isVolatile);
if (prop.noalias_scopes) attrs.append("noalias_scopes", prop.noalias_scopes);
if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
if (prop.tbaa) attrs.append("tbaa", prop.tbaa);
}
::llvm::LogicalResult MemsetOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAccessGroupsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(attr, "access_groups", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getAliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "alias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "arg_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getIsVolatileAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(attr, "isVolatile", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getNoaliasScopesAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(attr, "noalias_scopes", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "res_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getTbaaAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(attr, "tbaa", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MemsetOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.access_groups)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.alias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.isVolatile)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.noalias_scopes)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.tbaa)))
return ::mlir::failure();
return ::mlir::success();
}
void MemsetOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.access_groups);
writer.writeOptionalAttribute(prop.alias_scopes);
writer.writeOptionalAttribute(prop.arg_attrs);
writer.writeAttribute(prop.isVolatile);
writer.writeOptionalAttribute(prop.noalias_scopes);
writer.writeOptionalAttribute(prop.res_attrs);
writer.writeOptionalAttribute(prop.tbaa);
}
bool MemsetOp::getIsVolatile() {
auto attr = getIsVolatileAttr();
return attr.getValue().getZExtValue();
}
::std::optional< ::mlir::ArrayAttr > MemsetOp::getAccessGroups() {
auto attr = getAccessGroupsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOp::getAliasScopes() {
auto attr = getAliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOp::getNoaliasScopes() {
auto attr = getNoaliasScopesAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOp::getTbaa() {
auto attr = getTbaaAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOp::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > MemsetOp::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
void MemsetOp::setIsVolatile(bool attrValue) {
getProperties().isVolatile = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(1), attrValue);
}
void MemsetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value val, Value len, bool isVolatile) {
build(odsBuilder, odsState, dst, val, len,
odsBuilder.getBoolAttr(isVolatile));
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value val, Value len, bool isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value val, Value len, bool isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemsetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Value dst, Value val, Value len, IntegerAttr isVolatile) {
build(odsBuilder, odsState, dst, val, len, isVolatile,
/*access_groups=*/nullptr, /*alias_scopes=*/nullptr,
/*noalias_scopes=*/nullptr, /*tbaa=*/nullptr,
/*arg_attrs=*/nullptr, /*res_attrs=*/nullptr);
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value dst, Value val, Value len, IntegerAttr isVolatile) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, Value dst, Value val, Value len, IntegerAttr isVolatile) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile));
}
void MemsetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = isVolatile;
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, ::mlir::IntegerAttr isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(dst);
odsState.addOperands(val);
odsState.addOperands(len);
odsState.getOrAddProperties<Properties>().isVolatile = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(1), isVolatile);
if (access_groups) {
odsState.getOrAddProperties<Properties>().access_groups = access_groups;
}
if (alias_scopes) {
odsState.getOrAddProperties<Properties>().alias_scopes = alias_scopes;
}
if (noalias_scopes) {
odsState.getOrAddProperties<Properties>().noalias_scopes = noalias_scopes;
}
if (tbaa) {
odsState.getOrAddProperties<Properties>().tbaa = tbaa;
}
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dst, ::mlir::Value val, ::mlir::Value len, bool isVolatile, /*optional*/::mlir::ArrayAttr access_groups, /*optional*/::mlir::ArrayAttr alias_scopes, /*optional*/::mlir::ArrayAttr noalias_scopes, /*optional*/::mlir::ArrayAttr tbaa, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dst)>(dst), std::forward<decltype(val)>(val), std::forward<decltype(len)>(len), std::forward<decltype(isVolatile)>(isVolatile), std::forward<decltype(access_groups)>(access_groups), std::forward<decltype(alias_scopes)>(alias_scopes), std::forward<decltype(noalias_scopes)>(noalias_scopes), std::forward<decltype(tbaa)>(tbaa), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void MemsetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MemsetOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MemsetOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MemsetOp MemsetOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MemsetOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MemsetOp MemsetOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult MemsetOp::verifyInvariantsImpl() {
auto tblgen_access_groups = getProperties().access_groups; (void)tblgen_access_groups;
auto tblgen_alias_scopes = getProperties().alias_scopes; (void)tblgen_alias_scopes;
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_isVolatile = getProperties().isVolatile; (void)tblgen_isVolatile;
if (!tblgen_isVolatile) return emitOpError("requires attribute 'isVolatile'");
auto tblgen_noalias_scopes = getProperties().noalias_scopes; (void)tblgen_noalias_scopes;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
auto tblgen_tbaa = getProperties().tbaa; (void)tblgen_tbaa;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps2(*this, tblgen_isVolatile, "isVolatile")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps15(*this, tblgen_access_groups, "access_groups")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_alias_scopes, "alias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps16(*this, tblgen_noalias_scopes, "noalias_scopes")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps17(*this, tblgen_tbaa, "tbaa")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_arg_attrs, "arg_attrs")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_res_attrs, "res_attrs")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps14(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MemsetOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MemsetOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.isVolatile;
auto isVolatileAttrName = ::mlir::StringAttr::get(ctx, "isVolatile");
auto attr = dict.get(isVolatileAttrName);
usedKeys.insert(isVolatileAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for isVolatile in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `isVolatile` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.access_groups;
auto access_groupsAttrName = ::mlir::StringAttr::get(ctx, "access_groups");
auto attr = dict.get(access_groupsAttrName);
usedKeys.insert(access_groupsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for access_groups in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `access_groups` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.alias_scopes;
auto alias_scopesAttrName = ::mlir::StringAttr::get(ctx, "alias_scopes");
auto attr = dict.get(alias_scopesAttrName);
usedKeys.insert(alias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for alias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.noalias_scopes;
auto noalias_scopesAttrName = ::mlir::StringAttr::get(ctx, "noalias_scopes");
auto attr = dict.get(noalias_scopesAttrName);
usedKeys.insert(noalias_scopesAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for noalias_scopes in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `noalias_scopes` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.tbaa;
auto tbaaAttrName = ::mlir::StringAttr::get(ctx, "tbaa");
auto attr = dict.get(tbaaAttrName);
usedKeys.insert(tbaaAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for tbaa in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `tbaa` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.arg_attrs;
auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx, "arg_attrs");
auto attr = dict.get(arg_attrsAttrName);
usedKeys.insert(arg_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for arg_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto res_attrsAttrName = ::mlir::StringAttr::get(ctx, "res_attrs");
auto attr = dict.get(res_attrsAttrName);
usedKeys.insert(res_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for res_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void MemsetOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
{
auto valueRange = getODSOperandIndexAndLength(0);
for (unsigned idx = valueRange.first; idx < valueRange.first + valueRange.second; idx++) {
effects.emplace_back(::mlir::MemoryEffects::Write::get(), &getOperation()->getOpOperand(idx), 0, false, ::mlir::SideEffects::DefaultResource::get());
}
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MemsetOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MemsetOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MinNumOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MinNumOpGenericAdaptorBase::MinNumOpGenericAdaptorBase(MinNumOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr MinNumOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags MinNumOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
MinNumOpAdaptor::MinNumOpAdaptor(MinNumOp op) : MinNumOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MinNumOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.minnum' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult MinNumOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MinNumOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MinNumOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MinNumOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void MinNumOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void MinNumOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult MinNumOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MinNumOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void MinNumOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags MinNumOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void MinNumOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinNumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MinNumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MinNumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MinNumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MinNumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinNumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MinNumOp MinNumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MinNumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinNumOp MinNumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MinNumOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult MinNumOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MinNumOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MinNumOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult MinNumOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MinNumOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void MinNumOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MinNumOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MinNumOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::MinimumOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
MinimumOpGenericAdaptorBase::MinimumOpGenericAdaptorBase(MinimumOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr MinimumOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags MinimumOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
MinimumOpAdaptor::MinimumOpAdaptor(MinimumOp op) : MinimumOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult MinimumOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.minimum' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult MinimumOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute MinimumOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code MinimumOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> MinimumOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void MinimumOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void MinimumOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult MinimumOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult MinimumOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void MinimumOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags MinimumOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void MinimumOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinimumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinimumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void MinimumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MinimumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<MinimumOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinimumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void MinimumOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MinimumOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(MinimumOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
MinimumOp MinimumOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<MinimumOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
MinimumOp MinimumOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void MinimumOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult MinimumOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult MinimumOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult MinimumOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult MinimumOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void MinimumOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void MinimumOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::MinimumOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::MinimumOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::NearbyintOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
NearbyintOpGenericAdaptorBase::NearbyintOpGenericAdaptorBase(NearbyintOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr NearbyintOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags NearbyintOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
NearbyintOpAdaptor::NearbyintOpAdaptor(NearbyintOp op) : NearbyintOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult NearbyintOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.nearbyint' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult NearbyintOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute NearbyintOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code NearbyintOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> NearbyintOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void NearbyintOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void NearbyintOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult NearbyintOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult NearbyintOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void NearbyintOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags NearbyintOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void NearbyintOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(NearbyintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(NearbyintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void NearbyintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<NearbyintOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<NearbyintOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(NearbyintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void NearbyintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void NearbyintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(NearbyintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
NearbyintOp NearbyintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<NearbyintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NearbyintOp NearbyintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void NearbyintOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult NearbyintOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult NearbyintOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult NearbyintOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult NearbyintOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void NearbyintOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void NearbyintOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::NearbyintOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::NearbyintOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::NoAliasScopeDeclOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
NoAliasScopeDeclOpGenericAdaptorBase::NoAliasScopeDeclOpGenericAdaptorBase(NoAliasScopeDeclOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::AliasScopeAttr NoAliasScopeDeclOpGenericAdaptorBase::getScope() {
auto attr = getScopeAttr();
return ::llvm::cast<::mlir::LLVM::AliasScopeAttr>(attr);
}
} // namespace detail
NoAliasScopeDeclOpAdaptor::NoAliasScopeDeclOpAdaptor(NoAliasScopeDeclOp op) : NoAliasScopeDeclOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult NoAliasScopeDeclOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_scope = getProperties().scope; (void)tblgen_scope;
if (!tblgen_scope) return emitError(loc, "'llvm.intr.experimental.noalias.scope.decl' op requires attribute 'scope'");
if (tblgen_scope && !((::llvm::isa<::mlir::LLVM::AliasScopeAttr>(tblgen_scope))))
return emitError(loc, "'llvm.intr.experimental.noalias.scope.decl' op attribute 'scope' failed to satisfy constraint: LLVM dialect alias scope");
return ::mlir::success();
}
::llvm::LogicalResult NoAliasScopeDeclOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.scope;
auto attr = dict.get("scope");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `scope` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute NoAliasScopeDeclOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.scope;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("scope",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code NoAliasScopeDeclOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.scope.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> NoAliasScopeDeclOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "scope")
return prop.scope;
return std::nullopt;
}
void NoAliasScopeDeclOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "scope") {
prop.scope = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.scope)>>(value);
return;
}
}
void NoAliasScopeDeclOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.scope) attrs.append("scope", prop.scope);
}
::llvm::LogicalResult NoAliasScopeDeclOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getScopeAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps19(attr, "scope", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult NoAliasScopeDeclOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.scope)))
return ::mlir::failure();
return ::mlir::success();
}
void NoAliasScopeDeclOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.scope);
}
::mlir::LLVM::AliasScopeAttr NoAliasScopeDeclOp::getScope() {
auto attr = getScopeAttr();
return ::llvm::cast<::mlir::LLVM::AliasScopeAttr>(attr);
}
void NoAliasScopeDeclOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::LLVM::AliasScopeAttr scope) {
odsState.getOrAddProperties<Properties>().scope = scope;
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::LLVM::AliasScopeAttr scope) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(scope)>(scope));
auto __res__ = ::llvm::dyn_cast<NoAliasScopeDeclOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::LLVM::AliasScopeAttr scope) {
return create(builder, builder.getLoc(), std::forward<decltype(scope)>(scope));
}
void NoAliasScopeDeclOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::LLVM::AliasScopeAttr scope) {
odsState.getOrAddProperties<Properties>().scope = scope;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::LLVM::AliasScopeAttr scope) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(scope)>(scope));
auto __res__ = ::llvm::dyn_cast<NoAliasScopeDeclOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::LLVM::AliasScopeAttr scope) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(scope)>(scope));
}
void NoAliasScopeDeclOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<NoAliasScopeDeclOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<NoAliasScopeDeclOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void NoAliasScopeDeclOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<NoAliasScopeDeclOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
NoAliasScopeDeclOp NoAliasScopeDeclOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult NoAliasScopeDeclOp::verifyInvariantsImpl() {
auto tblgen_scope = getProperties().scope; (void)tblgen_scope;
if (!tblgen_scope) return emitOpError("requires attribute 'scope'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps19(*this, tblgen_scope, "scope")))
return ::mlir::failure();
return ::mlir::success();
}
::llvm::LogicalResult NoAliasScopeDeclOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult NoAliasScopeDeclOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::LLVM::AliasScopeAttr scopeAttr;
if (parser.parseCustomAttributeWithFallback(scopeAttr, ::mlir::Type{})) {
return ::mlir::failure();
}
if (scopeAttr) result.getOrAddProperties<NoAliasScopeDeclOp::Properties>().scope = scopeAttr;
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
return ::mlir::success();
}
void NoAliasScopeDeclOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter.printStrippedAttrOrType(getScopeAttr());
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("scope");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::NoAliasScopeDeclOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::NoAliasScopeDeclOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::PowIOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
PowIOpGenericAdaptorBase::PowIOpGenericAdaptorBase(PowIOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr PowIOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags PowIOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
PowIOpAdaptor::PowIOpAdaptor(PowIOp op) : PowIOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult PowIOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.powi' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult PowIOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute PowIOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code PowIOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> PowIOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void PowIOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void PowIOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult PowIOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult PowIOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void PowIOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags PowIOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void PowIOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void PowIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
PowIOp PowIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowIOp PowIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PowIOp PowIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowIOp PowIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
PowIOp PowIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowIOp PowIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.addOperands(power);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PowIOp PowIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowIOp PowIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value power, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(power)>(power), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowIOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<PowIOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
PowIOp PowIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PowIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowIOp PowIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PowIOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
PowIOp PowIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PowIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowIOp PowIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void PowIOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult PowIOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult PowIOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult PowIOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void PowIOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void PowIOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::PowIOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::PowIOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::PowOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
PowOpGenericAdaptorBase::PowOpGenericAdaptorBase(PowOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr PowOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags PowOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
PowOpAdaptor::PowOpAdaptor(PowOp op) : PowOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult PowOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.pow' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult PowOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute PowOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code PowOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> PowOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void PowOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void PowOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult PowOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult PowOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void PowOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags PowOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void PowOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PowOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PowOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void PowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<PowOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<PowOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PowOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void PowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PowOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
PowOp PowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PowOp PowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void PowOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult PowOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult PowOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult PowOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult PowOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void PowOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void PowOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::PowOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::PowOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::Prefetch definitions
//===----------------------------------------------------------------------===//
namespace detail {
PrefetchGenericAdaptorBase::PrefetchGenericAdaptorBase(Prefetch op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint32_t PrefetchGenericAdaptorBase::getRw() {
auto attr = getRwAttr();
return attr.getValue().getZExtValue();
}
uint32_t PrefetchGenericAdaptorBase::getHint() {
auto attr = getHintAttr();
return attr.getValue().getZExtValue();
}
uint32_t PrefetchGenericAdaptorBase::getCache() {
auto attr = getCacheAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
PrefetchAdaptor::PrefetchAdaptor(Prefetch op) : PrefetchGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult PrefetchAdaptor::verify(::mlir::Location loc) {
auto tblgen_cache = getProperties().cache; (void)tblgen_cache;
if (!tblgen_cache) return emitError(loc, "'llvm.intr.prefetch' op requires attribute 'cache'");
auto tblgen_hint = getProperties().hint; (void)tblgen_hint;
if (!tblgen_hint) return emitError(loc, "'llvm.intr.prefetch' op requires attribute 'hint'");
auto tblgen_rw = getProperties().rw; (void)tblgen_rw;
if (!tblgen_rw) return emitError(loc, "'llvm.intr.prefetch' op requires attribute 'rw'");
if (tblgen_rw && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_rw))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_rw).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.prefetch' op attribute 'rw' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_hint && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_hint))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_hint).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.prefetch' op attribute 'hint' failed to satisfy constraint: 32-bit signless integer attribute");
if (tblgen_cache && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_cache))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_cache).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.prefetch' op attribute 'cache' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult Prefetch::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.cache;
auto attr = dict.get("cache");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `cache` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.hint;
auto attr = dict.get("hint");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `hint` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.rw;
auto attr = dict.get("rw");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `rw` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute Prefetch::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.cache;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("cache",
propStorage));
}
{
const auto &propStorage = prop.hint;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("hint",
propStorage));
}
{
const auto &propStorage = prop.rw;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("rw",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code Prefetch::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.cache.getAsOpaquePointer()),
llvm::hash_value(prop.hint.getAsOpaquePointer()),
llvm::hash_value(prop.rw.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> Prefetch::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "cache")
return prop.cache;
if (name == "hint")
return prop.hint;
if (name == "rw")
return prop.rw;
return std::nullopt;
}
void Prefetch::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "cache") {
prop.cache = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.cache)>>(value);
return;
}
if (name == "hint") {
prop.hint = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.hint)>>(value);
return;
}
if (name == "rw") {
prop.rw = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.rw)>>(value);
return;
}
}
void Prefetch::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.cache) attrs.append("cache", prop.cache);
if (prop.hint) attrs.append("hint", prop.hint);
if (prop.rw) attrs.append("rw", prop.rw);
}
::llvm::LogicalResult Prefetch::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getCacheAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "cache", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getHintAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "hint", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getRwAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "rw", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult Prefetch::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.cache)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.hint)))
return ::mlir::failure();
if (::mlir::failed(reader.readAttribute(prop.rw)))
return ::mlir::failure();
return ::mlir::success();
}
void Prefetch::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.cache);
writer.writeAttribute(prop.hint);
writer.writeAttribute(prop.rw);
}
uint32_t Prefetch::getRw() {
auto attr = getRwAttr();
return attr.getValue().getZExtValue();
}
uint32_t Prefetch::getHint() {
auto attr = getHintAttr();
return attr.getValue().getZExtValue();
}
uint32_t Prefetch::getCache() {
auto attr = getCacheAttr();
return attr.getValue().getZExtValue();
}
void Prefetch::setRw(uint32_t attrValue) {
getProperties().rw = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void Prefetch::setHint(uint32_t attrValue) {
getProperties().hint = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void Prefetch::setCache(uint32_t attrValue) {
getProperties().cache = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void Prefetch::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value addr, ::mlir::IntegerAttr rw, ::mlir::IntegerAttr hint, ::mlir::IntegerAttr cache) {
odsState.addOperands(addr);
odsState.getOrAddProperties<Properties>().rw = rw;
odsState.getOrAddProperties<Properties>().hint = hint;
odsState.getOrAddProperties<Properties>().cache = cache;
}
Prefetch Prefetch::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value addr, ::mlir::IntegerAttr rw, ::mlir::IntegerAttr hint, ::mlir::IntegerAttr cache) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
auto __res__ = ::llvm::dyn_cast<Prefetch>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Prefetch Prefetch::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value addr, ::mlir::IntegerAttr rw, ::mlir::IntegerAttr hint, ::mlir::IntegerAttr cache) {
return create(builder, builder.getLoc(), std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
}
void Prefetch::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::IntegerAttr rw, ::mlir::IntegerAttr hint, ::mlir::IntegerAttr cache) {
odsState.addOperands(addr);
odsState.getOrAddProperties<Properties>().rw = rw;
odsState.getOrAddProperties<Properties>().hint = hint;
odsState.getOrAddProperties<Properties>().cache = cache;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Prefetch Prefetch::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::IntegerAttr rw, ::mlir::IntegerAttr hint, ::mlir::IntegerAttr cache) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
auto __res__ = ::llvm::dyn_cast<Prefetch>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Prefetch Prefetch::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value addr, ::mlir::IntegerAttr rw, ::mlir::IntegerAttr hint, ::mlir::IntegerAttr cache) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
}
void Prefetch::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value addr, uint32_t rw, uint32_t hint, uint32_t cache) {
odsState.addOperands(addr);
odsState.getOrAddProperties<Properties>().rw = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rw);
odsState.getOrAddProperties<Properties>().hint = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), hint);
odsState.getOrAddProperties<Properties>().cache = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), cache);
}
Prefetch Prefetch::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value addr, uint32_t rw, uint32_t hint, uint32_t cache) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
auto __res__ = ::llvm::dyn_cast<Prefetch>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Prefetch Prefetch::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value addr, uint32_t rw, uint32_t hint, uint32_t cache) {
return create(builder, builder.getLoc(), std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
}
void Prefetch::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value addr, uint32_t rw, uint32_t hint, uint32_t cache) {
odsState.addOperands(addr);
odsState.getOrAddProperties<Properties>().rw = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), rw);
odsState.getOrAddProperties<Properties>().hint = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), hint);
odsState.getOrAddProperties<Properties>().cache = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), cache);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Prefetch Prefetch::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value addr, uint32_t rw, uint32_t hint, uint32_t cache) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
auto __res__ = ::llvm::dyn_cast<Prefetch>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Prefetch Prefetch::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value addr, uint32_t rw, uint32_t hint, uint32_t cache) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(addr)>(addr), std::forward<decltype(rw)>(rw), std::forward<decltype(hint)>(hint), std::forward<decltype(cache)>(cache));
}
void Prefetch::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<Prefetch::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
Prefetch Prefetch::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Prefetch>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Prefetch Prefetch::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Prefetch::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Prefetch Prefetch::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Prefetch>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Prefetch Prefetch::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult Prefetch::verifyInvariantsImpl() {
auto tblgen_cache = getProperties().cache; (void)tblgen_cache;
if (!tblgen_cache) return emitOpError("requires attribute 'cache'");
auto tblgen_hint = getProperties().hint; (void)tblgen_hint;
if (!tblgen_hint) return emitOpError("requires attribute 'hint'");
auto tblgen_rw = getProperties().rw; (void)tblgen_rw;
if (!tblgen_rw) return emitOpError("requires attribute 'rw'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_rw, "rw")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_hint, "hint")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_cache, "cache")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult Prefetch::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult Prefetch::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.rw;
auto rwAttrName = ::mlir::StringAttr::get(ctx, "rw");
auto attr = dict.get(rwAttrName);
usedKeys.insert(rwAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for rw in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `rw` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.hint;
auto hintAttrName = ::mlir::StringAttr::get(ctx, "hint");
auto attr = dict.get(hintAttrName);
usedKeys.insert(hintAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for hint in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `hint` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.cache;
auto cacheAttrName = ::mlir::StringAttr::get(ctx, "cache");
auto attr = dict.get(cacheAttrName);
usedKeys.insert(cacheAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for cache in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `cache` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::Prefetch)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::PrefetchGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::PtrAnnotation definitions
//===----------------------------------------------------------------------===//
namespace detail {
PtrAnnotationGenericAdaptorBase::PtrAnnotationGenericAdaptorBase(PtrAnnotation op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
PtrAnnotationAdaptor::PtrAnnotationAdaptor(PtrAnnotation op) : PtrAnnotationGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult PtrAnnotationAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult PtrAnnotation::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute PtrAnnotation::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code PtrAnnotation::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> PtrAnnotation::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void PtrAnnotation::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void PtrAnnotation::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult PtrAnnotation::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void PtrAnnotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
odsState.addOperands(ptr);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
odsState.addOperands(attr);
odsState.addTypes(res);
}
PtrAnnotation PtrAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
auto __res__ = ::llvm::dyn_cast<PtrAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrAnnotation PtrAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
}
void PtrAnnotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
odsState.addOperands(ptr);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
odsState.addOperands(attr);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PtrAnnotation::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
PtrAnnotation PtrAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(ptr)>(ptr), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
auto __res__ = ::llvm::dyn_cast<PtrAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrAnnotation PtrAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
return create(builder, builder.getLoc(), std::forward<decltype(ptr)>(ptr), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
}
void PtrAnnotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
odsState.addOperands(ptr);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
odsState.addOperands(attr);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PtrAnnotation PtrAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
auto __res__ = ::llvm::dyn_cast<PtrAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrAnnotation PtrAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
}
void PtrAnnotation::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
PtrAnnotation PtrAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PtrAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrAnnotation PtrAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PtrAnnotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PtrAnnotation::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
PtrAnnotation PtrAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PtrAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrAnnotation PtrAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PtrAnnotation::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
PtrAnnotation PtrAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PtrAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrAnnotation PtrAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void PtrAnnotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PtrAnnotation::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
PtrAnnotation PtrAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PtrAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrAnnotation PtrAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult PtrAnnotation::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup4 = getODSOperands(4);
for (auto v : valueGroup4) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType()) && ((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()))))
return emitOpError("failed to verify that all of {res, ptr} have same type");
if (!((((*this->getODSOperands(1).begin()).getType()) == ((*this->getODSOperands(2).begin()).getType()) && ((*this->getODSOperands(2).begin()).getType()) == ((*this->getODSOperands(4).begin()).getType()) && ((*this->getODSOperands(4).begin()).getType()) == ((*this->getODSOperands(1).begin()).getType()))))
return emitOpError("failed to verify that all of {annotation, fileName, attr} have same type");
return ::mlir::success();
}
::llvm::LogicalResult PtrAnnotation::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult PtrAnnotation::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::llvm::LogicalResult PtrAnnotation::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::PtrAnnotation)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::PtrMaskOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
PtrMaskOpGenericAdaptorBase::PtrMaskOpGenericAdaptorBase(PtrMaskOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
PtrMaskOpAdaptor::PtrMaskOpAdaptor(PtrMaskOp op) : PtrMaskOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult PtrMaskOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult PtrMaskOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute PtrMaskOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code PtrMaskOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> PtrMaskOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void PtrMaskOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void PtrMaskOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult PtrMaskOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void PtrMaskOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask) {
odsState.addOperands(ptr);
odsState.addOperands(mask);
odsState.addTypes(res);
}
PtrMaskOp PtrMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask));
auto __res__ = ::llvm::dyn_cast<PtrMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrMaskOp PtrMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask));
}
void PtrMaskOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ptr, ::mlir::Value mask) {
odsState.addOperands(ptr);
odsState.addOperands(mask);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PtrMaskOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
PtrMaskOp PtrMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value ptr, ::mlir::Value mask) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask));
auto __res__ = ::llvm::dyn_cast<PtrMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrMaskOp PtrMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value ptr, ::mlir::Value mask) {
return create(builder, builder.getLoc(), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask));
}
void PtrMaskOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask) {
odsState.addOperands(ptr);
odsState.addOperands(mask);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
PtrMaskOp PtrMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask));
auto __res__ = ::llvm::dyn_cast<PtrMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrMaskOp PtrMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask));
}
void PtrMaskOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
PtrMaskOp PtrMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PtrMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrMaskOp PtrMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PtrMaskOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PtrMaskOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
PtrMaskOp PtrMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<PtrMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrMaskOp PtrMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void PtrMaskOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
PtrMaskOp PtrMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PtrMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrMaskOp PtrMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void PtrMaskOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(PtrMaskOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
PtrMaskOp PtrMaskOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<PtrMaskOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
PtrMaskOp PtrMaskOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult PtrMaskOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps15(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps16(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps15(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()) && ((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType()))))
return emitOpError("failed to verify that all of {ptr, res} have same type");
return ::mlir::success();
}
::llvm::LogicalResult PtrMaskOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult PtrMaskOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult PtrMaskOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand maskRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> maskOperands(&maskRawOperand, 1); ::llvm::SMLoc maskOperandsLoc;
(void)maskOperandsLoc;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
maskOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(maskRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(::llvm::concat<const ::mlir::OpAsmParser::UnresolvedOperand>(ptrOperands, maskOperands), allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void PtrMaskOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getPtr();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getMask();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void PtrMaskOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::PtrMaskOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::RintOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
RintOpGenericAdaptorBase::RintOpGenericAdaptorBase(RintOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr RintOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags RintOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
RintOpAdaptor::RintOpAdaptor(RintOp op) : RintOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult RintOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.rint' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult RintOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute RintOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code RintOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> RintOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void RintOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void RintOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult RintOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult RintOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void RintOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags RintOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void RintOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<RintOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<RintOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void RintOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void RintOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RintOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
RintOp RintOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RintOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RintOp RintOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void RintOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult RintOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult RintOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult RintOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult RintOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void RintOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void RintOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::RintOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::RintOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::RoundEvenOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
RoundEvenOpGenericAdaptorBase::RoundEvenOpGenericAdaptorBase(RoundEvenOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr RoundEvenOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags RoundEvenOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
RoundEvenOpAdaptor::RoundEvenOpAdaptor(RoundEvenOp op) : RoundEvenOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult RoundEvenOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.roundeven' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult RoundEvenOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute RoundEvenOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code RoundEvenOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> RoundEvenOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void RoundEvenOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void RoundEvenOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult RoundEvenOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult RoundEvenOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void RoundEvenOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags RoundEvenOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void RoundEvenOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundEvenOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundEvenOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundEvenOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<RoundEvenOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<RoundEvenOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundEvenOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void RoundEvenOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void RoundEvenOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundEvenOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
RoundEvenOp RoundEvenOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RoundEvenOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundEvenOp RoundEvenOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void RoundEvenOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult RoundEvenOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult RoundEvenOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult RoundEvenOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult RoundEvenOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void RoundEvenOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void RoundEvenOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::RoundEvenOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::RoundEvenOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::RoundOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
RoundOpGenericAdaptorBase::RoundOpGenericAdaptorBase(RoundOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr RoundOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags RoundOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
RoundOpAdaptor::RoundOpAdaptor(RoundOp op) : RoundOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult RoundOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.round' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult RoundOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute RoundOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code RoundOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> RoundOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void RoundOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void RoundOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult RoundOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult RoundOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void RoundOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags RoundOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void RoundOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void RoundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<RoundOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<RoundOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void RoundOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void RoundOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(RoundOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
RoundOp RoundOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<RoundOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
RoundOp RoundOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void RoundOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult RoundOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult RoundOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult RoundOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult RoundOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void RoundOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void RoundOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::RoundOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::RoundOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SAddSat definitions
//===----------------------------------------------------------------------===//
namespace detail {
SAddSatGenericAdaptorBase::SAddSatGenericAdaptorBase(SAddSat op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SAddSatAdaptor::SAddSatAdaptor(SAddSat op) : SAddSatGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SAddSatAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SAddSat::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SAddSat::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SAddSat::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SAddSat::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SAddSat::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SAddSat::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SAddSat::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
SAddSat SAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddSat SAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SAddSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SAddSat SAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddSat SAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SAddSat SAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddSat SAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SAddSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SAddSat SAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddSat SAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SAddSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SAddSat SAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddSat SAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SAddSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SAddSat SAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddSat SAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SAddSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SAddSat SAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddSat SAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SAddSat::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SAddSat::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SAddSat::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SAddSat::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SAddSat::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SAddSat::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SAddSat)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SAddWithOverflowOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SAddWithOverflowOpGenericAdaptorBase::SAddWithOverflowOpGenericAdaptorBase(SAddWithOverflowOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SAddWithOverflowOpAdaptor::SAddWithOverflowOpAdaptor(SAddWithOverflowOp op) : SAddWithOverflowOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SAddWithOverflowOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SAddWithOverflowOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SAddWithOverflowOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SAddWithOverflowOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SAddWithOverflowOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SAddWithOverflowOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SAddWithOverflowOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SAddWithOverflowOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SAddWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
odsState.addTypes(res);
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<SAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void SAddWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<SAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void SAddWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SAddWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SAddWithOverflowOp SAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SAddWithOverflowOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SAddWithOverflowOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SAddWithOverflowOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void SAddWithOverflowOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SAddWithOverflowOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SCmpOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SCmpOpGenericAdaptorBase::SCmpOpGenericAdaptorBase(SCmpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SCmpOpAdaptor::SCmpOpAdaptor(SCmpOp op) : SCmpOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SCmpOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SCmpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SCmpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SCmpOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SCmpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SCmpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SCmpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SCmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
SCmpOp SCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SCmpOp SCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SCmpOp SCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SCmpOp SCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SCmpOp SCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SCmpOp SCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SCmpOp SCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SCmpOp SCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SCmpOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SCmpOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult SCmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SCmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SCmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SCmpOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SMaxOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SMaxOpGenericAdaptorBase::SMaxOpGenericAdaptorBase(SMaxOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SMaxOpAdaptor::SMaxOpAdaptor(SMaxOp op) : SMaxOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SMaxOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SMaxOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SMaxOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SMaxOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SMaxOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SMaxOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SMaxOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SMaxOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
SMaxOp SMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMaxOp SMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SMaxOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SMaxOp SMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMaxOp SMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SMaxOp SMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMaxOp SMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SMaxOp SMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMaxOp SMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SMaxOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SMaxOp SMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMaxOp SMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SMaxOp SMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMaxOp SMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SMaxOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SMaxOp SMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMaxOp SMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SMaxOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SMaxOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SMaxOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SMaxOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SMaxOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SMaxOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SMaxOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SMinOpGenericAdaptorBase::SMinOpGenericAdaptorBase(SMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SMinOpAdaptor::SMinOpAdaptor(SMinOp op) : SMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
SMinOp SMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMinOp SMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SMinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SMinOp SMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMinOp SMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SMinOp SMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMinOp SMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SMinOp SMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMinOp SMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SMinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SMinOp SMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMinOp SMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SMinOp SMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMinOp SMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SMinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SMinOp SMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMinOp SMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SMinOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SMinOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SMinOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SMulWithOverflowOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SMulWithOverflowOpGenericAdaptorBase::SMulWithOverflowOpGenericAdaptorBase(SMulWithOverflowOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SMulWithOverflowOpAdaptor::SMulWithOverflowOpAdaptor(SMulWithOverflowOp op) : SMulWithOverflowOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SMulWithOverflowOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SMulWithOverflowOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SMulWithOverflowOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SMulWithOverflowOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SMulWithOverflowOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SMulWithOverflowOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SMulWithOverflowOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SMulWithOverflowOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SMulWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
odsState.addTypes(res);
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<SMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void SMulWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<SMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void SMulWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SMulWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SMulWithOverflowOp SMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SMulWithOverflowOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SMulWithOverflowOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SMulWithOverflowOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void SMulWithOverflowOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SMulWithOverflowOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SSACopyOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SSACopyOpGenericAdaptorBase::SSACopyOpGenericAdaptorBase(SSACopyOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SSACopyOpAdaptor::SSACopyOpAdaptor(SSACopyOp op) : SSACopyOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SSACopyOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SSACopyOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SSACopyOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SSACopyOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SSACopyOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SSACopyOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SSACopyOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SSACopyOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SSACopyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value operand) {
odsState.addOperands(operand);
odsState.addTypes(res);
}
SSACopyOp SSACopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value operand) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(operand)>(operand));
auto __res__ = ::llvm::dyn_cast<SSACopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSACopyOp SSACopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value operand) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(operand)>(operand));
}
void SSACopyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value operand) {
odsState.addOperands(operand);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSACopyOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SSACopyOp SSACopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value operand) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operand)>(operand));
auto __res__ = ::llvm::dyn_cast<SSACopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSACopyOp SSACopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value operand) {
return create(builder, builder.getLoc(), std::forward<decltype(operand)>(operand));
}
void SSACopyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
odsState.addOperands(operand);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SSACopyOp SSACopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
auto __res__ = ::llvm::dyn_cast<SSACopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSACopyOp SSACopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operand)>(operand));
}
void SSACopyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSACopyOp SSACopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SSACopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSACopyOp SSACopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SSACopyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSACopyOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SSACopyOp SSACopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SSACopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSACopyOp SSACopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SSACopyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSACopyOp SSACopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SSACopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSACopyOp SSACopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SSACopyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSACopyOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SSACopyOp SSACopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SSACopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSACopyOp SSACopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SSACopyOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps17(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SSACopyOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SSACopyOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SSACopyOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand operandRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> operandOperands(&operandRawOperand, 1); ::llvm::SMLoc operandOperandsLoc;
(void)operandOperandsLoc;
::mlir::Type operandRawType{};
::llvm::ArrayRef<::mlir::Type> operandTypes(&operandRawType, 1);
operandOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(operandRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::Type type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
operandRawType = type;
}
result.addTypes(operandTypes[0]);
if (parser.resolveOperands(operandOperands, operandTypes, operandOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SSACopyOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getOperand();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getOperand().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void SSACopyOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SSACopyOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SSHLSat definitions
//===----------------------------------------------------------------------===//
namespace detail {
SSHLSatGenericAdaptorBase::SSHLSatGenericAdaptorBase(SSHLSat op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SSHLSatAdaptor::SSHLSatAdaptor(SSHLSat op) : SSHLSatGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SSHLSatAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SSHLSat::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SSHLSat::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SSHLSat::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SSHLSat::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SSHLSat::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SSHLSat::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SSHLSat::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SSHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
SSHLSat SSHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SSHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSHLSat SSHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SSHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSHLSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SSHLSat SSHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SSHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSHLSat SSHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SSHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SSHLSat SSHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SSHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSHLSat SSHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SSHLSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSHLSat SSHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SSHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSHLSat SSHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SSHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSHLSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SSHLSat SSHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SSHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSHLSat SSHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SSHLSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSHLSat SSHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SSHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSHLSat SSHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SSHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSHLSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SSHLSat SSHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SSHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSHLSat SSHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SSHLSat::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SSHLSat::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SSHLSat::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SSHLSat::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SSHLSat::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SSHLSat::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SSHLSat)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SSubSat definitions
//===----------------------------------------------------------------------===//
namespace detail {
SSubSatGenericAdaptorBase::SSubSatGenericAdaptorBase(SSubSat op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SSubSatAdaptor::SSubSatAdaptor(SSubSat op) : SSubSatGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SSubSatAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SSubSat::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SSubSat::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SSubSat::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SSubSat::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SSubSat::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SSubSat::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SSubSat::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SSubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
SSubSat SSubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SSubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubSat SSubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SSubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSubSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SSubSat SSubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SSubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubSat SSubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SSubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SSubSat SSubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<SSubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubSat SSubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void SSubSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSubSat SSubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SSubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubSat SSubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SSubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSubSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SSubSat SSubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SSubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubSat SSubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SSubSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSubSat SSubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SSubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubSat SSubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SSubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SSubSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SSubSat SSubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SSubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubSat SSubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SSubSat::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SSubSat::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SSubSat::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SSubSat::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SSubSat::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SSubSat::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SSubSat)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SSubWithOverflowOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SSubWithOverflowOpGenericAdaptorBase::SSubWithOverflowOpGenericAdaptorBase(SSubWithOverflowOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
SSubWithOverflowOpAdaptor::SSubWithOverflowOpAdaptor(SSubWithOverflowOp op) : SSubWithOverflowOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SSubWithOverflowOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult SSubWithOverflowOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute SSubWithOverflowOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SSubWithOverflowOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> SSubWithOverflowOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void SSubWithOverflowOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void SSubWithOverflowOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult SSubWithOverflowOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void SSubWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
odsState.addTypes(res);
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<SSubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void SSubWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<SSubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void SSubWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SSubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SSubWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SSubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SSubWithOverflowOp SSubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult SSubWithOverflowOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SSubWithOverflowOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SSubWithOverflowOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void SSubWithOverflowOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SSubWithOverflowOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SinOpGenericAdaptorBase::SinOpGenericAdaptorBase(SinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr SinOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags SinOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
SinOpAdaptor::SinOpAdaptor(SinOp op) : SinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SinOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.sin' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult SinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute SinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> SinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void SinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void SinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult SinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult SinOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void SinOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags SinOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void SinOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<SinOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<SinOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SinOp SinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinOp SinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SinOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult SinOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SinOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SinOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SinOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SinOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::SinOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SincosOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SincosOpGenericAdaptorBase::SincosOpGenericAdaptorBase(SincosOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr SincosOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags SincosOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
SincosOpAdaptor::SincosOpAdaptor(SincosOp op) : SincosOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SincosOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.sincos' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult SincosOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute SincosOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SincosOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> SincosOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void SincosOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void SincosOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult SincosOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult SincosOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void SincosOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags SincosOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void SincosOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void SincosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
SincosOp SincosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SincosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SincosOp SincosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SincosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(val);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SincosOp SincosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SincosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SincosOp SincosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SincosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
SincosOp SincosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SincosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SincosOp SincosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SincosOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(val);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SincosOp SincosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SincosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SincosOp SincosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SincosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<SincosOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
SincosOp SincosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SincosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SincosOp SincosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SincosOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SincosOp SincosOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SincosOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SincosOp SincosOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SincosOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult SincosOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SincosOp::verifyInvariants() {
if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
return ::mlir::success();
return ::mlir::failure();
}
::mlir::ParseResult SincosOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SincosOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SincosOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SincosOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::SincosOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SinhOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SinhOpGenericAdaptorBase::SinhOpGenericAdaptorBase(SinhOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr SinhOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags SinhOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
SinhOpAdaptor::SinhOpAdaptor(SinhOp op) : SinhOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SinhOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.sinh' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult SinhOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute SinhOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SinhOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> SinhOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void SinhOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void SinhOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult SinhOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult SinhOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void SinhOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags SinhOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void SinhOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SinhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<SinhOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<SinhOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SinhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SinhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SinhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SinhOp SinhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SinhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SinhOp SinhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SinhOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult SinhOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SinhOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SinhOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SinhOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SinhOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SinhOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SinhOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::SinhOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::SqrtOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
SqrtOpGenericAdaptorBase::SqrtOpGenericAdaptorBase(SqrtOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr SqrtOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags SqrtOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
SqrtOpAdaptor::SqrtOpAdaptor(SqrtOp op) : SqrtOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult SqrtOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.sqrt' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult SqrtOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute SqrtOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code SqrtOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> SqrtOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void SqrtOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void SqrtOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult SqrtOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult SqrtOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void SqrtOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags SqrtOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void SqrtOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SqrtOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SqrtOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void SqrtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<SqrtOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<SqrtOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SqrtOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void SqrtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SqrtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(SqrtOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
SqrtOp SqrtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<SqrtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
SqrtOp SqrtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void SqrtOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult SqrtOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult SqrtOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult SqrtOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult SqrtOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void SqrtOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void SqrtOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::SqrtOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::SqrtOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::StackRestoreOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
StackRestoreOpGenericAdaptorBase::StackRestoreOpGenericAdaptorBase(StackRestoreOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
StackRestoreOpAdaptor::StackRestoreOpAdaptor(StackRestoreOp op) : StackRestoreOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult StackRestoreOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult StackRestoreOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute StackRestoreOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code StackRestoreOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> StackRestoreOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void StackRestoreOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void StackRestoreOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult StackRestoreOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void StackRestoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ptr) {
odsState.addOperands(ptr);
}
StackRestoreOp StackRestoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<StackRestoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackRestoreOp StackRestoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(ptr)>(ptr));
}
void StackRestoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
odsState.addOperands(ptr);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
StackRestoreOp StackRestoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<StackRestoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackRestoreOp StackRestoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
}
void StackRestoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StackRestoreOp StackRestoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<StackRestoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackRestoreOp StackRestoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void StackRestoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StackRestoreOp StackRestoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<StackRestoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackRestoreOp StackRestoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult StackRestoreOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult StackRestoreOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult StackRestoreOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::Type ptrRawType{};
::llvm::ArrayRef<::mlir::Type> ptrTypes(&ptrRawType, 1);
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(ptrRawType))
return ::mlir::failure();
if (parser.resolveOperands(ptrOperands, ptrTypes, ptrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void StackRestoreOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getPtr();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getPtr().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::StackRestoreOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::StackSaveOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
StackSaveOpGenericAdaptorBase::StackSaveOpGenericAdaptorBase(StackSaveOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
StackSaveOpAdaptor::StackSaveOpAdaptor(StackSaveOp op) : StackSaveOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult StackSaveOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult StackSaveOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute StackSaveOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code StackSaveOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> StackSaveOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void StackSaveOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void StackSaveOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult StackSaveOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void StackSaveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res) {
odsState.addTypes(res);
}
StackSaveOp StackSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res));
auto __res__ = ::llvm::dyn_cast<StackSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackSaveOp StackSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res));
}
void StackSaveOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
StackSaveOp StackSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes));
auto __res__ = ::llvm::dyn_cast<StackSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackSaveOp StackSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes));
}
void StackSaveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StackSaveOp StackSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<StackSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackSaveOp StackSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void StackSaveOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StackSaveOp StackSaveOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<StackSaveOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StackSaveOp StackSaveOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult StackSaveOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult StackSaveOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult StackSaveOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(resRawType))
return ::mlir::failure();
result.addTypes(resTypes);
return ::mlir::success();
}
void StackSaveOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getRes().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::StackSaveOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::StepVectorOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
StepVectorOpGenericAdaptorBase::StepVectorOpGenericAdaptorBase(StepVectorOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
StepVectorOpAdaptor::StepVectorOpAdaptor(StepVectorOp op) : StepVectorOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult StepVectorOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult StepVectorOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute StepVectorOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code StepVectorOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> StepVectorOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void StepVectorOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void StepVectorOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult StepVectorOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void StepVectorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res) {
odsState.addTypes(res);
}
StepVectorOp StepVectorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res));
auto __res__ = ::llvm::dyn_cast<StepVectorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StepVectorOp StepVectorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res));
}
void StepVectorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
StepVectorOp StepVectorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes));
auto __res__ = ::llvm::dyn_cast<StepVectorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StepVectorOp StepVectorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes));
}
void StepVectorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StepVectorOp StepVectorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<StepVectorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StepVectorOp StepVectorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void StepVectorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StepVectorOp StepVectorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<StepVectorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StepVectorOp StepVectorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult StepVectorOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult StepVectorOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult StepVectorOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
result.addTypes(resTypes);
return ::mlir::success();
}
void StepVectorOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void StepVectorOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::StepVectorOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::StripInvariantGroupOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
StripInvariantGroupOpGenericAdaptorBase::StripInvariantGroupOpGenericAdaptorBase(StripInvariantGroupOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
StripInvariantGroupOpAdaptor::StripInvariantGroupOpAdaptor(StripInvariantGroupOp op) : StripInvariantGroupOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult StripInvariantGroupOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult StripInvariantGroupOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute StripInvariantGroupOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code StripInvariantGroupOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> StripInvariantGroupOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void StripInvariantGroupOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void StripInvariantGroupOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult StripInvariantGroupOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void StripInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptr) {
odsState.addOperands(ptr);
odsState.addTypes(res);
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<StripInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr));
}
void StripInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value ptr) {
odsState.addOperands(ptr);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(StripInvariantGroupOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<StripInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(ptr)>(ptr));
}
void StripInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
odsState.addOperands(ptr);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
auto __res__ = ::llvm::dyn_cast<StripInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr));
}
void StripInvariantGroupOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<StripInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void StripInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(StripInvariantGroupOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<StripInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void StripInvariantGroupOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<StripInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void StripInvariantGroupOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(StripInvariantGroupOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<StripInvariantGroupOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
StripInvariantGroupOp StripInvariantGroupOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult StripInvariantGroupOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult StripInvariantGroupOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult StripInvariantGroupOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult StripInvariantGroupOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand ptrRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrOperands(&ptrRawOperand, 1); ::llvm::SMLoc ptrOperandsLoc;
(void)ptrOperandsLoc;
::mlir::Type ptrRawType{};
::llvm::ArrayRef<::mlir::Type> ptrTypes(&ptrRawType, 1);
ptrOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(ptrRawType))
return ::mlir::failure();
result.addTypes(ptrTypes[0]);
if (parser.resolveOperands(ptrOperands, ptrTypes, ptrOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void StripInvariantGroupOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getPtr();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getPtr().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::StripInvariantGroupOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::TanOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
TanOpGenericAdaptorBase::TanOpGenericAdaptorBase(TanOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr TanOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags TanOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
TanOpAdaptor::TanOpAdaptor(TanOp op) : TanOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult TanOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.tan' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult TanOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute TanOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code TanOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> TanOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void TanOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void TanOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult TanOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult TanOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void TanOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags TanOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void TanOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<TanOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<TanOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void TanOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void TanOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
TanOp TanOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<TanOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanOp TanOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void TanOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult TanOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult TanOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult TanOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult TanOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void TanOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void TanOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::TanOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::TanOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::TanhOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
TanhOpGenericAdaptorBase::TanhOpGenericAdaptorBase(TanhOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr TanhOpGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags TanhOpGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
TanhOpAdaptor::TanhOpAdaptor(TanhOp op) : TanhOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult TanhOpAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.tanh' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult TanhOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute TanhOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code TanhOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> TanhOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void TanhOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void TanhOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult TanhOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult TanhOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void TanhOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags TanhOp::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void TanhOp::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void TanhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<TanhOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<TanhOp::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void TanhOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void TanhOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(TanhOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
TanhOp TanhOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<TanhOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
TanhOp TanhOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void TanhOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult TanhOp::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps1(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult TanhOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult TanhOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult TanhOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void TanhOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void TanhOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::TanhOp)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::TanhOpGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::ThreadlocalAddressOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
ThreadlocalAddressOpGenericAdaptorBase::ThreadlocalAddressOpGenericAdaptorBase(ThreadlocalAddressOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
ThreadlocalAddressOpAdaptor::ThreadlocalAddressOpAdaptor(ThreadlocalAddressOp op) : ThreadlocalAddressOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult ThreadlocalAddressOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult ThreadlocalAddressOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute ThreadlocalAddressOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code ThreadlocalAddressOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> ThreadlocalAddressOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void ThreadlocalAddressOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void ThreadlocalAddressOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult ThreadlocalAddressOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void ThreadlocalAddressOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value global) {
odsState.addOperands(global);
odsState.addTypes(res);
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value global) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(global)>(global));
auto __res__ = ::llvm::dyn_cast<ThreadlocalAddressOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value global) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(global)>(global));
}
void ThreadlocalAddressOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value global) {
odsState.addOperands(global);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value global) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(global)>(global));
auto __res__ = ::llvm::dyn_cast<ThreadlocalAddressOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value global) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(global)>(global));
}
void ThreadlocalAddressOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<ThreadlocalAddressOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void ThreadlocalAddressOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<ThreadlocalAddressOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
ThreadlocalAddressOp ThreadlocalAddressOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult ThreadlocalAddressOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult ThreadlocalAddressOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult ThreadlocalAddressOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void ThreadlocalAddressOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::ThreadlocalAddressOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::Trap definitions
//===----------------------------------------------------------------------===//
namespace detail {
TrapGenericAdaptorBase::TrapGenericAdaptorBase(Trap op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
TrapAdaptor::TrapAdaptor(Trap op) : TrapGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult TrapAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult Trap::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute Trap::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code Trap::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> Trap::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void Trap::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void Trap::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult Trap::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void Trap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState) {
}
Trap Trap::create(::mlir::OpBuilder &builder, ::mlir::Location location) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__);
auto __res__ = ::llvm::dyn_cast<Trap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Trap Trap::create(::mlir::ImplicitLocOpBuilder &builder) {
return create(builder, builder.getLoc());
}
void Trap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
Trap Trap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes));
auto __res__ = ::llvm::dyn_cast<Trap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Trap Trap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes));
}
void Trap::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Trap Trap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<Trap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Trap Trap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void Trap::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
Trap Trap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<Trap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
Trap Trap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult Trap::verifyInvariantsImpl() {
return ::mlir::success();
}
::llvm::LogicalResult Trap::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult Trap::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
return ::mlir::success();
}
void Trap::print(::mlir::OpAsmPrinter &_odsPrinter) {
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::Trap)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::UAddSat definitions
//===----------------------------------------------------------------------===//
namespace detail {
UAddSatGenericAdaptorBase::UAddSatGenericAdaptorBase(UAddSat op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
UAddSatAdaptor::UAddSatAdaptor(UAddSat op) : UAddSatGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UAddSatAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult UAddSat::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute UAddSat::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code UAddSat::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> UAddSat::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void UAddSat::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void UAddSat::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult UAddSat::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void UAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
UAddSat UAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddSat UAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UAddSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
UAddSat UAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddSat UAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UAddSat UAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddSat UAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UAddSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UAddSat UAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddSat UAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UAddSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
UAddSat UAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddSat UAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UAddSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UAddSat UAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddSat UAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void UAddSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UAddSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
UAddSat UAddSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UAddSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddSat UAddSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UAddSat::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult UAddSat::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult UAddSat::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult UAddSat::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void UAddSat::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void UAddSat::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::UAddSat)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::UAddWithOverflowOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
UAddWithOverflowOpGenericAdaptorBase::UAddWithOverflowOpGenericAdaptorBase(UAddWithOverflowOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
UAddWithOverflowOpAdaptor::UAddWithOverflowOpAdaptor(UAddWithOverflowOp op) : UAddWithOverflowOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UAddWithOverflowOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult UAddWithOverflowOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute UAddWithOverflowOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code UAddWithOverflowOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> UAddWithOverflowOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void UAddWithOverflowOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void UAddWithOverflowOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult UAddWithOverflowOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void UAddWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
odsState.addTypes(res);
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<UAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void UAddWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<UAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void UAddWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UAddWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UAddWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UAddWithOverflowOp UAddWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UAddWithOverflowOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult UAddWithOverflowOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult UAddWithOverflowOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void UAddWithOverflowOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::UAddWithOverflowOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::UBSanTrap definitions
//===----------------------------------------------------------------------===//
namespace detail {
UBSanTrapGenericAdaptorBase::UBSanTrapGenericAdaptorBase(UBSanTrap op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint8_t UBSanTrapGenericAdaptorBase::getFailureKind() {
auto attr = getFailureKindAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
UBSanTrapAdaptor::UBSanTrapAdaptor(UBSanTrap op) : UBSanTrapGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UBSanTrapAdaptor::verify(::mlir::Location loc) {
auto tblgen_failureKind = getProperties().failureKind; (void)tblgen_failureKind;
if (!tblgen_failureKind) return emitError(loc, "'llvm.intr.ubsantrap' op requires attribute 'failureKind'");
if (tblgen_failureKind && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_failureKind))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_failureKind).getType().isSignlessInteger(8)))))
return emitError(loc, "'llvm.intr.ubsantrap' op attribute 'failureKind' failed to satisfy constraint: 8-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult UBSanTrap::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.failureKind;
auto attr = dict.get("failureKind");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `failureKind` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute UBSanTrap::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.failureKind;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("failureKind",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code UBSanTrap::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.failureKind.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> UBSanTrap::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "failureKind")
return prop.failureKind;
return std::nullopt;
}
void UBSanTrap::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "failureKind") {
prop.failureKind = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.failureKind)>>(value);
return;
}
}
void UBSanTrap::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.failureKind) attrs.append("failureKind", prop.failureKind);
}
::llvm::LogicalResult UBSanTrap::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFailureKindAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps20(attr, "failureKind", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult UBSanTrap::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.failureKind)))
return ::mlir::failure();
return ::mlir::success();
}
void UBSanTrap::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.failureKind);
}
uint8_t UBSanTrap::getFailureKind() {
auto attr = getFailureKindAttr();
return attr.getValue().getZExtValue();
}
void UBSanTrap::setFailureKind(uint8_t attrValue) {
getProperties().failureKind = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(8), attrValue);
}
void UBSanTrap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::IntegerAttr failureKind) {
odsState.getOrAddProperties<Properties>().failureKind = failureKind;
}
UBSanTrap UBSanTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::IntegerAttr failureKind) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(failureKind)>(failureKind));
auto __res__ = ::llvm::dyn_cast<UBSanTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UBSanTrap UBSanTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::IntegerAttr failureKind) {
return create(builder, builder.getLoc(), std::forward<decltype(failureKind)>(failureKind));
}
void UBSanTrap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr failureKind) {
odsState.getOrAddProperties<Properties>().failureKind = failureKind;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UBSanTrap UBSanTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr failureKind) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(failureKind)>(failureKind));
auto __res__ = ::llvm::dyn_cast<UBSanTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UBSanTrap UBSanTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::IntegerAttr failureKind) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(failureKind)>(failureKind));
}
void UBSanTrap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, uint8_t failureKind) {
odsState.getOrAddProperties<Properties>().failureKind = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(8), failureKind);
}
UBSanTrap UBSanTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, uint8_t failureKind) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(failureKind)>(failureKind));
auto __res__ = ::llvm::dyn_cast<UBSanTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UBSanTrap UBSanTrap::create(::mlir::ImplicitLocOpBuilder &builder, uint8_t failureKind) {
return create(builder, builder.getLoc(), std::forward<decltype(failureKind)>(failureKind));
}
void UBSanTrap::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, uint8_t failureKind) {
odsState.getOrAddProperties<Properties>().failureKind = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(8), failureKind);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UBSanTrap UBSanTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, uint8_t failureKind) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(failureKind)>(failureKind));
auto __res__ = ::llvm::dyn_cast<UBSanTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UBSanTrap UBSanTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, uint8_t failureKind) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(failureKind)>(failureKind));
}
void UBSanTrap::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<UBSanTrap::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
UBSanTrap UBSanTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UBSanTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UBSanTrap UBSanTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UBSanTrap::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UBSanTrap UBSanTrap::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UBSanTrap>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UBSanTrap UBSanTrap::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UBSanTrap::verifyInvariantsImpl() {
auto tblgen_failureKind = getProperties().failureKind; (void)tblgen_failureKind;
if (!tblgen_failureKind) return emitOpError("requires attribute 'failureKind'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps20(*this, tblgen_failureKind, "failureKind")))
return ::mlir::failure();
return ::mlir::success();
}
::llvm::LogicalResult UBSanTrap::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult UBSanTrap::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
if (parseProperties(parser, result))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult UBSanTrap::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.failureKind;
auto failureKindAttrName = ::mlir::StringAttr::get(ctx, "failureKind");
auto attr = dict.get(failureKindAttrName);
usedKeys.insert(failureKindAttrName);
if (attr || /*isRequired=*/true) {
if (!attr) {
emitError() << "expected key entry for failureKind in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `failureKind` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void UBSanTrap::print(::mlir::OpAsmPrinter &_odsPrinter) {
::llvm::SmallVector<::llvm::StringRef, 2> elidedProps;
_odsPrinter << " ";
printProperties(this->getContext(), _odsPrinter, getProperties(), elidedProps);
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict(llvm::to_vector((*this)->getDiscardableAttrs()), elidedAttrs);
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::UBSanTrap)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::UBSanTrapGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::UCmpOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
UCmpOpGenericAdaptorBase::UCmpOpGenericAdaptorBase(UCmpOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
UCmpOpAdaptor::UCmpOpAdaptor(UCmpOp op) : UCmpOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UCmpOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult UCmpOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute UCmpOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code UCmpOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> UCmpOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void UCmpOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void UCmpOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult UCmpOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void UCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
UCmpOp UCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UCmpOp UCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UCmpOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UCmpOp UCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UCmpOp UCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UCmpOp UCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UCmpOp UCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UCmpOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UCmpOp UCmpOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UCmpOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UCmpOp UCmpOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UCmpOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult UCmpOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult UCmpOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void UCmpOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void UCmpOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::UCmpOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::UMaxOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
UMaxOpGenericAdaptorBase::UMaxOpGenericAdaptorBase(UMaxOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
UMaxOpAdaptor::UMaxOpAdaptor(UMaxOp op) : UMaxOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UMaxOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult UMaxOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute UMaxOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code UMaxOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> UMaxOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void UMaxOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void UMaxOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult UMaxOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void UMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
UMaxOp UMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMaxOp UMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UMaxOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
UMaxOp UMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMaxOp UMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UMaxOp UMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMaxOp UMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UMaxOp UMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMaxOp UMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UMaxOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
UMaxOp UMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMaxOp UMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UMaxOp UMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMaxOp UMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void UMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UMaxOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
UMaxOp UMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMaxOp UMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UMaxOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult UMaxOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult UMaxOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult UMaxOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void UMaxOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void UMaxOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::UMaxOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::UMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
UMinOpGenericAdaptorBase::UMinOpGenericAdaptorBase(UMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
UMinOpAdaptor::UMinOpAdaptor(UMinOp op) : UMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult UMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute UMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code UMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> UMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void UMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void UMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult UMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void UMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
UMinOp UMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMinOp UMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UMinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
UMinOp UMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMinOp UMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UMinOp UMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<UMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMinOp UMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void UMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UMinOp UMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMinOp UMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UMinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
UMinOp UMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMinOp UMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UMinOp UMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMinOp UMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void UMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(UMinOp::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
UMinOp UMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMinOp UMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult UMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult UMinOp::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult UMinOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void UMinOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void UMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::UMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::UMulWithOverflowOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
UMulWithOverflowOpGenericAdaptorBase::UMulWithOverflowOpGenericAdaptorBase(UMulWithOverflowOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
UMulWithOverflowOpAdaptor::UMulWithOverflowOpAdaptor(UMulWithOverflowOp op) : UMulWithOverflowOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult UMulWithOverflowOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult UMulWithOverflowOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute UMulWithOverflowOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code UMulWithOverflowOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> UMulWithOverflowOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void UMulWithOverflowOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void UMulWithOverflowOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult UMulWithOverflowOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void UMulWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
odsState.addTypes(res);
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<UMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void UMulWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<UMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void UMulWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<UMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void UMulWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<UMulWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
UMulWithOverflowOp UMulWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult UMulWithOverflowOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult UMulWithOverflowOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult UMulWithOverflowOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void UMulWithOverflowOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::UMulWithOverflowOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::USHLSat definitions
//===----------------------------------------------------------------------===//
namespace detail {
USHLSatGenericAdaptorBase::USHLSatGenericAdaptorBase(USHLSat op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
USHLSatAdaptor::USHLSatAdaptor(USHLSat op) : USHLSatGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult USHLSatAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult USHLSat::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute USHLSat::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code USHLSat::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> USHLSat::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void USHLSat::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void USHLSat::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult USHLSat::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void USHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
USHLSat USHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<USHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USHLSat USHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void USHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(USHLSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
USHLSat USHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<USHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USHLSat USHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void USHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
USHLSat USHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<USHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USHLSat USHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void USHLSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
USHLSat USHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<USHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USHLSat USHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void USHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(USHLSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
USHLSat USHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<USHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USHLSat USHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void USHLSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
USHLSat USHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<USHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USHLSat USHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void USHLSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(USHLSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
USHLSat USHLSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<USHLSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USHLSat USHLSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult USHLSat::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult USHLSat::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult USHLSat::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult USHLSat::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void USHLSat::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void USHLSat::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::USHLSat)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::USubSat definitions
//===----------------------------------------------------------------------===//
namespace detail {
USubSatGenericAdaptorBase::USubSatGenericAdaptorBase(USubSat op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
USubSatAdaptor::USubSatAdaptor(USubSat op) : USubSatGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult USubSatAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult USubSat::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute USubSat::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code USubSat::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> USubSat::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void USubSat::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void USubSat::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult USubSat::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void USubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
odsState.addTypes(res);
}
USubSat USubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<USubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubSat USubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void USubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(USubSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
USubSat USubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<USubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubSat USubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void USubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
odsState.addOperands(a);
odsState.addOperands(b);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
USubSat USubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
auto __res__ = ::llvm::dyn_cast<USubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubSat USubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value a, ::mlir::Value b) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(a)>(a), std::forward<decltype(b)>(b));
}
void USubSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
USubSat USubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<USubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubSat USubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void USubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(USubSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
USubSat USubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<USubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubSat USubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void USubSat::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
USubSat USubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<USubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubSat USubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void USubSat::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(USubSat::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
USubSat USubSat::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<USubSat>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubSat USubSat::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult USubSat::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult USubSat::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult USubSat::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult USubSat::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void USubSat::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void USubSat::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::USubSat)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::USubWithOverflowOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
USubWithOverflowOpGenericAdaptorBase::USubWithOverflowOpGenericAdaptorBase(USubWithOverflowOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
USubWithOverflowOpAdaptor::USubWithOverflowOpAdaptor(USubWithOverflowOp op) : USubWithOverflowOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult USubWithOverflowOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult USubWithOverflowOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute USubWithOverflowOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code USubWithOverflowOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> USubWithOverflowOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void USubWithOverflowOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void USubWithOverflowOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult USubWithOverflowOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void USubWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
odsState.addTypes(res);
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<USubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void USubWithOverflowOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
odsState.addOperands(odsArg_0);
odsState.addOperands(odsArg_1);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
auto __res__ = ::llvm::dyn_cast<USubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value odsArg_0, ::mlir::Value odsArg_1) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(odsArg_0)>(odsArg_0), std::forward<decltype(odsArg_1)>(odsArg_1));
}
void USubWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<USubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void USubWithOverflowOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<USubWithOverflowOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
USubWithOverflowOp USubWithOverflowOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult USubWithOverflowOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps3(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult USubWithOverflowOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult USubWithOverflowOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void USubWithOverflowOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::USubWithOverflowOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPAShrOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPAShrOpGenericAdaptorBase::VPAShrOpGenericAdaptorBase(VPAShrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPAShrOpAdaptor::VPAShrOpAdaptor(VPAShrOp op) : VPAShrOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPAShrOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPAShrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPAShrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPAShrOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPAShrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPAShrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPAShrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPAShrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPAShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPAShrOp VPAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPAShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAShrOp VPAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPAShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPAShrOp VPAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPAShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAShrOp VPAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPAShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPAShrOp VPAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPAShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAShrOp VPAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPAShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPAShrOp VPAShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPAShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAShrOp VPAShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPAShrOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPAShrOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPAShrOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPAShrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPAShrOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPAddOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPAddOpGenericAdaptorBase::VPAddOpGenericAdaptorBase(VPAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPAddOpAdaptor::VPAddOpAdaptor(VPAddOp op) : VPAddOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPAddOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPAddOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPAddOp VPAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAddOp VPAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPAddOp VPAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAddOp VPAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPAddOp VPAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAddOp VPAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPAddOp VPAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAddOp VPAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPAddOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPAddOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPAddOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPAddOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPAndOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPAndOpGenericAdaptorBase::VPAndOpGenericAdaptorBase(VPAndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPAndOpAdaptor::VPAndOpAdaptor(VPAndOp op) : VPAndOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPAndOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPAndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPAndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPAndOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPAndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPAndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPAndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPAndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPAndOp VPAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAndOp VPAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPAndOp VPAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAndOp VPAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPAndOp VPAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAndOp VPAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPAndOp VPAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPAndOp VPAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPAndOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPAndOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPAndOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPAndOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPAndOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFAddOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFAddOpGenericAdaptorBase::VPFAddOpGenericAdaptorBase(VPFAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFAddOpAdaptor::VPFAddOpAdaptor(VPFAddOp op) : VPFAddOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFAddOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFAddOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFAddOp VPFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFAddOp VPFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFAddOp VPFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFAddOp VPFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFAddOp VPFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFAddOp VPFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFAddOp VPFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFAddOp VPFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFAddOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFAddOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFAddOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFAddOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFDivOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFDivOpGenericAdaptorBase::VPFDivOpGenericAdaptorBase(VPFDivOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFDivOpAdaptor::VPFDivOpAdaptor(VPFDivOp op) : VPFDivOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFDivOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFDivOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFDivOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFDivOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFDivOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFDivOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFDivOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFDivOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFDivOp VPFDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFDivOp VPFDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFDivOp VPFDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFDivOp VPFDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFDivOp VPFDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFDivOp VPFDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFDivOp VPFDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFDivOp VPFDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFDivOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFDivOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFDivOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFDivOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFDivOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFMulAddOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFMulAddOpGenericAdaptorBase::VPFMulAddOpGenericAdaptorBase(VPFMulAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFMulAddOpAdaptor::VPFMulAddOpAdaptor(VPFMulAddOp op) : VPFMulAddOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFMulAddOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFMulAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFMulAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFMulAddOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFMulAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFMulAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFMulAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFMulAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(op1);
odsState.addOperands(op2);
odsState.addOperands(op3);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFMulAddOp VPFMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulAddOp VPFMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFMulAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(op1);
odsState.addOperands(op2);
odsState.addOperands(op3);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFMulAddOp VPFMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulAddOp VPFMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFMulAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFMulAddOp VPFMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulAddOp VPFMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFMulAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFMulAddOp VPFMulAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFMulAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulAddOp VPFMulAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFMulAddOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup4 = getODSOperands(4);
for (auto v : valueGroup4) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFMulAddOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFMulAddOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFMulAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFMulAddOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFMulOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFMulOpGenericAdaptorBase::VPFMulOpGenericAdaptorBase(VPFMulOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFMulOpAdaptor::VPFMulOpAdaptor(VPFMulOp op) : VPFMulOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFMulOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFMulOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFMulOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFMulOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFMulOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFMulOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFMulOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFMulOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFMulOp VPFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulOp VPFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFMulOp VPFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulOp VPFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFMulOp VPFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulOp VPFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFMulOp VPFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFMulOp VPFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFMulOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFMulOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFMulOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFMulOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFMulOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFNegOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFNegOpGenericAdaptorBase::VPFNegOpGenericAdaptorBase(VPFNegOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFNegOpAdaptor::VPFNegOpAdaptor(VPFNegOp op) : VPFNegOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFNegOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFNegOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFNegOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFNegOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFNegOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFNegOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFNegOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFNegOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFNegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value op, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(op);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFNegOp VPFNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value op, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(op)>(op), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFNegOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFNegOp VPFNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value op, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(op)>(op), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFNegOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value op, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(op);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFNegOp VPFNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value op, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(op)>(op), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFNegOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFNegOp VPFNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value op, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(op)>(op), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFNegOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFNegOp VPFNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFNegOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFNegOp VPFNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFNegOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFNegOp VPFNegOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFNegOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFNegOp VPFNegOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFNegOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFNegOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFNegOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFNegOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFNegOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFPExtOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFPExtOpGenericAdaptorBase::VPFPExtOpGenericAdaptorBase(VPFPExtOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFPExtOpAdaptor::VPFPExtOpAdaptor(VPFPExtOp op) : VPFPExtOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFPExtOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFPExtOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFPExtOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFPExtOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFPExtOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFPExtOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFPExtOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFPExtOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFPExtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFPExtOp VPFPExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPExtOp VPFPExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPExtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFPExtOp VPFPExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPExtOp VPFPExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPExtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPExtOp VPFPExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFPExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPExtOp VPFPExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFPExtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPExtOp VPFPExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFPExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPExtOp VPFPExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFPExtOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFPExtOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFPExtOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFPExtOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFPExtOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFPToSIOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFPToSIOpGenericAdaptorBase::VPFPToSIOpGenericAdaptorBase(VPFPToSIOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFPToSIOpAdaptor::VPFPToSIOpAdaptor(VPFPToSIOp op) : VPFPToSIOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFPToSIOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFPToSIOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFPToSIOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFPToSIOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFPToSIOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFPToSIOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFPToSIOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFPToSIOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFPToSIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFPToSIOp VPFPToSIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPToSIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToSIOp VPFPToSIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPToSIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFPToSIOp VPFPToSIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPToSIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToSIOp VPFPToSIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPToSIOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPToSIOp VPFPToSIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFPToSIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToSIOp VPFPToSIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFPToSIOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPToSIOp VPFPToSIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFPToSIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToSIOp VPFPToSIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFPToSIOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFPToSIOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFPToSIOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFPToSIOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFPToSIOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFPToUIOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFPToUIOpGenericAdaptorBase::VPFPToUIOpGenericAdaptorBase(VPFPToUIOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFPToUIOpAdaptor::VPFPToUIOpAdaptor(VPFPToUIOp op) : VPFPToUIOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFPToUIOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFPToUIOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFPToUIOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFPToUIOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFPToUIOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFPToUIOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFPToUIOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFPToUIOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFPToUIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFPToUIOp VPFPToUIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPToUIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToUIOp VPFPToUIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPToUIOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFPToUIOp VPFPToUIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPToUIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToUIOp VPFPToUIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPToUIOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPToUIOp VPFPToUIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFPToUIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToUIOp VPFPToUIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFPToUIOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPToUIOp VPFPToUIOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFPToUIOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPToUIOp VPFPToUIOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFPToUIOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFPToUIOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFPToUIOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFPToUIOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFPToUIOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFPTruncOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFPTruncOpGenericAdaptorBase::VPFPTruncOpGenericAdaptorBase(VPFPTruncOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFPTruncOpAdaptor::VPFPTruncOpAdaptor(VPFPTruncOp op) : VPFPTruncOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFPTruncOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFPTruncOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFPTruncOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFPTruncOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFPTruncOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFPTruncOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFPTruncOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFPTruncOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFPTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFPTruncOp VPFPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPTruncOp VPFPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFPTruncOp VPFPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPTruncOp VPFPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFPTruncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPTruncOp VPFPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPTruncOp VPFPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFPTruncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFPTruncOp VPFPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFPTruncOp VPFPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFPTruncOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFPTruncOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFPTruncOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFPTruncOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFPTruncOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFRemOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFRemOpGenericAdaptorBase::VPFRemOpGenericAdaptorBase(VPFRemOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFRemOpAdaptor::VPFRemOpAdaptor(VPFRemOp op) : VPFRemOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFRemOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFRemOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFRemOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFRemOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFRemOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFRemOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFRemOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFRemOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFRemOp VPFRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFRemOp VPFRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFRemOp VPFRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFRemOp VPFRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFRemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFRemOp VPFRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFRemOp VPFRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFRemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFRemOp VPFRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFRemOp VPFRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFRemOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFRemOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFRemOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFRemOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFRemOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFSubOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFSubOpGenericAdaptorBase::VPFSubOpGenericAdaptorBase(VPFSubOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFSubOpAdaptor::VPFSubOpAdaptor(VPFSubOp op) : VPFSubOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFSubOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFSubOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFSubOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFSubOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFSubOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFSubOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFSubOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFSubOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFSubOp VPFSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFSubOp VPFSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFSubOp VPFSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFSubOp VPFSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFSubOp VPFSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFSubOp VPFSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFSubOp VPFSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFSubOp VPFSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFSubOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFSubOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFSubOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFSubOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFSubOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPFmaOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPFmaOpGenericAdaptorBase::VPFmaOpGenericAdaptorBase(VPFmaOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPFmaOpAdaptor::VPFmaOpAdaptor(VPFmaOp op) : VPFmaOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPFmaOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPFmaOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPFmaOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPFmaOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPFmaOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPFmaOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPFmaOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPFmaOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPFmaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(op1);
odsState.addOperands(op2);
odsState.addOperands(op3);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPFmaOp VPFmaOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFmaOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFmaOp VPFmaOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFmaOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(op1);
odsState.addOperands(op2);
odsState.addOperands(op3);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPFmaOp VPFmaOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPFmaOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFmaOp VPFmaOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value op1, ::mlir::Value op2, ::mlir::Value op3, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(op1)>(op1), std::forward<decltype(op2)>(op2), std::forward<decltype(op3)>(op3), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPFmaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFmaOp VPFmaOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPFmaOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFmaOp VPFmaOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPFmaOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPFmaOp VPFmaOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPFmaOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPFmaOp VPFmaOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPFmaOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup4 = getODSOperands(4);
for (auto v : valueGroup4) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPFmaOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPFmaOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPFmaOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPFmaOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPIntToPtrOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPIntToPtrOpGenericAdaptorBase::VPIntToPtrOpGenericAdaptorBase(VPIntToPtrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPIntToPtrOpAdaptor::VPIntToPtrOpAdaptor(VPIntToPtrOp op) : VPIntToPtrOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPIntToPtrOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPIntToPtrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPIntToPtrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPIntToPtrOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPIntToPtrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPIntToPtrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPIntToPtrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPIntToPtrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPIntToPtrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPIntToPtrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPIntToPtrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPIntToPtrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPIntToPtrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPIntToPtrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPIntToPtrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPIntToPtrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPIntToPtrOp VPIntToPtrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPIntToPtrOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPIntToPtrOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPIntToPtrOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPIntToPtrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPIntToPtrOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPLShrOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPLShrOpGenericAdaptorBase::VPLShrOpGenericAdaptorBase(VPLShrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPLShrOpAdaptor::VPLShrOpAdaptor(VPLShrOp op) : VPLShrOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPLShrOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPLShrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPLShrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPLShrOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPLShrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPLShrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPLShrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPLShrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPLShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPLShrOp VPLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPLShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLShrOp VPLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPLShrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPLShrOp VPLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPLShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLShrOp VPLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPLShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPLShrOp VPLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPLShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLShrOp VPLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPLShrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPLShrOp VPLShrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPLShrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLShrOp VPLShrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPLShrOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPLShrOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPLShrOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPLShrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPLShrOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPLoadOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPLoadOpGenericAdaptorBase::VPLoadOpGenericAdaptorBase(VPLoadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPLoadOpAdaptor::VPLoadOpAdaptor(VPLoadOp op) : VPLoadOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPLoadOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPLoadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPLoadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPLoadOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPLoadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPLoadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPLoadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPLoadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(ptr);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPLoadOp VPLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLoadOp VPLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(ptr);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPLoadOp VPLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLoadOp VPLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPLoadOp VPLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLoadOp VPLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPLoadOp VPLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPLoadOp VPLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPLoadOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPLoadOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPLoadOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPLoadOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPMergeMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPMergeMinOpGenericAdaptorBase::VPMergeMinOpGenericAdaptorBase(VPMergeMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPMergeMinOpAdaptor::VPMergeMinOpAdaptor(VPMergeMinOp op) : VPMergeMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPMergeMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPMergeMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPMergeMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPMergeMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPMergeMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPMergeMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPMergeMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPMergeMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPMergeMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
odsState.addOperands(cond);
odsState.addOperands(true_val);
odsState.addOperands(false_val);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPMergeMinOp VPMergeMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPMergeMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMergeMinOp VPMergeMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
}
void VPMergeMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
odsState.addOperands(cond);
odsState.addOperands(true_val);
odsState.addOperands(false_val);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPMergeMinOp VPMergeMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPMergeMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMergeMinOp VPMergeMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
}
void VPMergeMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPMergeMinOp VPMergeMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPMergeMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMergeMinOp VPMergeMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPMergeMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPMergeMinOp VPMergeMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPMergeMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMergeMinOp VPMergeMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPMergeMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPMergeMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPMergeMinOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPMergeMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPMergeMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPMulOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPMulOpGenericAdaptorBase::VPMulOpGenericAdaptorBase(VPMulOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPMulOpAdaptor::VPMulOpAdaptor(VPMulOp op) : VPMulOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPMulOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPMulOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPMulOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPMulOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPMulOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPMulOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPMulOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPMulOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPMulOp VPMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMulOp VPMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPMulOp VPMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMulOp VPMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPMulOp VPMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMulOp VPMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPMulOp VPMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPMulOp VPMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPMulOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPMulOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPMulOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPMulOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPMulOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPOrOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPOrOpGenericAdaptorBase::VPOrOpGenericAdaptorBase(VPOrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPOrOpAdaptor::VPOrOpAdaptor(VPOrOp op) : VPOrOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPOrOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPOrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPOrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPOrOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPOrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPOrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPOrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPOrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPOrOp VPOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPOrOp VPOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPOrOp VPOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPOrOp VPOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPOrOp VPOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPOrOp VPOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPOrOp VPOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPOrOp VPOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPOrOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPOrOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPOrOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPOrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPOrOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPPtrToIntOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPPtrToIntOpGenericAdaptorBase::VPPtrToIntOpGenericAdaptorBase(VPPtrToIntOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPPtrToIntOpAdaptor::VPPtrToIntOpAdaptor(VPPtrToIntOp op) : VPPtrToIntOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPPtrToIntOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPPtrToIntOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPPtrToIntOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPPtrToIntOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPPtrToIntOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPPtrToIntOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPPtrToIntOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPPtrToIntOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPPtrToIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPPtrToIntOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPPtrToIntOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPPtrToIntOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPPtrToIntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPPtrToIntOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPPtrToIntOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPPtrToIntOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPPtrToIntOp VPPtrToIntOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPPtrToIntOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps20(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPPtrToIntOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPPtrToIntOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPPtrToIntOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPPtrToIntOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceAddOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceAddOpGenericAdaptorBase::VPReduceAddOpGenericAdaptorBase(VPReduceAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceAddOpAdaptor::VPReduceAddOpAdaptor(VPReduceAddOp op) : VPReduceAddOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceAddOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceAddOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceAddOp VPReduceAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAddOp VPReduceAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceAddOp VPReduceAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAddOp VPReduceAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceAddOp VPReduceAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAddOp VPReduceAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceAddOp VPReduceAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAddOp VPReduceAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceAddOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceAddOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceAddOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceAddOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceAndOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceAndOpGenericAdaptorBase::VPReduceAndOpGenericAdaptorBase(VPReduceAndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceAndOpAdaptor::VPReduceAndOpAdaptor(VPReduceAndOp op) : VPReduceAndOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceAndOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceAndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceAndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceAndOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceAndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceAndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceAndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceAndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceAndOp VPReduceAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAndOp VPReduceAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceAndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceAndOp VPReduceAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAndOp VPReduceAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceAndOp VPReduceAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAndOp VPReduceAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceAndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceAndOp VPReduceAndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceAndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceAndOp VPReduceAndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceAndOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceAndOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceAndOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceAndOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceAndOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceFAddOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceFAddOpGenericAdaptorBase::VPReduceFAddOpGenericAdaptorBase(VPReduceFAddOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceFAddOpAdaptor::VPReduceFAddOpAdaptor(VPReduceFAddOp op) : VPReduceFAddOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceFAddOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFAddOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceFAddOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceFAddOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceFAddOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceFAddOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceFAddOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceFAddOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceFAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFAddOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceFAddOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFAddOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFAddOp VPReduceFAddOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceFAddOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps21(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFAddOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceFAddOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceFAddOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceFAddOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceFMaxOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceFMaxOpGenericAdaptorBase::VPReduceFMaxOpGenericAdaptorBase(VPReduceFMaxOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceFMaxOpAdaptor::VPReduceFMaxOpAdaptor(VPReduceFMaxOp op) : VPReduceFMaxOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceFMaxOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFMaxOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceFMaxOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceFMaxOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceFMaxOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceFMaxOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceFMaxOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceFMaxOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceFMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceFMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMaxOp VPReduceFMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceFMaxOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps21(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFMaxOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceFMaxOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceFMaxOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceFMaxOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceFMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceFMinOpGenericAdaptorBase::VPReduceFMinOpGenericAdaptorBase(VPReduceFMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceFMinOpAdaptor::VPReduceFMinOpAdaptor(VPReduceFMinOp op) : VPReduceFMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceFMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceFMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceFMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceFMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceFMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceFMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceFMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceFMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceFMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMinOp VPReduceFMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceFMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps21(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceFMinOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceFMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceFMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceFMulOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceFMulOpGenericAdaptorBase::VPReduceFMulOpGenericAdaptorBase(VPReduceFMulOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceFMulOpAdaptor::VPReduceFMulOpAdaptor(VPReduceFMulOp op) : VPReduceFMulOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceFMulOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFMulOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceFMulOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceFMulOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceFMulOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceFMulOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceFMulOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceFMulOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceFMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceFMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceFMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceFMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceFMulOp VPReduceFMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceFMulOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps21(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceFMulOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceFMulOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceFMulOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceFMulOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceMulOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceMulOpGenericAdaptorBase::VPReduceMulOpGenericAdaptorBase(VPReduceMulOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceMulOpAdaptor::VPReduceMulOpAdaptor(VPReduceMulOp op) : VPReduceMulOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceMulOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceMulOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceMulOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceMulOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceMulOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceMulOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceMulOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceMulOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceMulOp VPReduceMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceMulOp VPReduceMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceMulOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceMulOp VPReduceMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceMulOp VPReduceMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceMulOp VPReduceMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceMulOp VPReduceMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceMulOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceMulOp VPReduceMulOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceMulOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceMulOp VPReduceMulOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceMulOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceMulOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceMulOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceMulOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceMulOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceOrOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceOrOpGenericAdaptorBase::VPReduceOrOpGenericAdaptorBase(VPReduceOrOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceOrOpAdaptor::VPReduceOrOpAdaptor(VPReduceOrOp op) : VPReduceOrOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceOrOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceOrOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceOrOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceOrOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceOrOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceOrOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceOrOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceOrOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceOrOp VPReduceOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceOrOp VPReduceOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceOrOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceOrOp VPReduceOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceOrOp VPReduceOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceOrOp VPReduceOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceOrOp VPReduceOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceOrOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceOrOp VPReduceOrOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceOrOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceOrOp VPReduceOrOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceOrOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceOrOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceOrOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceOrOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceOrOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceSMaxOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceSMaxOpGenericAdaptorBase::VPReduceSMaxOpGenericAdaptorBase(VPReduceSMaxOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceSMaxOpAdaptor::VPReduceSMaxOpAdaptor(VPReduceSMaxOp op) : VPReduceSMaxOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceSMaxOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceSMaxOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceSMaxOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceSMaxOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceSMaxOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceSMaxOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceSMaxOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceSMaxOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceSMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceSMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceSMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceSMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMaxOp VPReduceSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceSMaxOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceSMaxOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceSMaxOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceSMaxOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceSMaxOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceSMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceSMinOpGenericAdaptorBase::VPReduceSMinOpGenericAdaptorBase(VPReduceSMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceSMinOpAdaptor::VPReduceSMinOpAdaptor(VPReduceSMinOp op) : VPReduceSMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceSMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceSMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceSMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceSMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceSMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceSMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceSMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceSMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceSMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceSMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceSMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceSMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceSMinOp VPReduceSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceSMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceSMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceSMinOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceSMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceSMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceUMaxOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceUMaxOpGenericAdaptorBase::VPReduceUMaxOpGenericAdaptorBase(VPReduceUMaxOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceUMaxOpAdaptor::VPReduceUMaxOpAdaptor(VPReduceUMaxOp op) : VPReduceUMaxOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceUMaxOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceUMaxOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceUMaxOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceUMaxOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceUMaxOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceUMaxOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceUMaxOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceUMaxOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceUMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceUMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceUMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceUMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMaxOp VPReduceUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceUMaxOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceUMaxOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceUMaxOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceUMaxOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceUMaxOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceUMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceUMinOpGenericAdaptorBase::VPReduceUMinOpGenericAdaptorBase(VPReduceUMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceUMinOpAdaptor::VPReduceUMinOpAdaptor(VPReduceUMinOp op) : VPReduceUMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceUMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceUMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceUMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceUMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceUMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceUMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceUMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceUMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceUMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceUMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceUMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceUMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceUMinOp VPReduceUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceUMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceUMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceUMinOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceUMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceUMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPReduceXorOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPReduceXorOpGenericAdaptorBase::VPReduceXorOpGenericAdaptorBase(VPReduceXorOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPReduceXorOpAdaptor::VPReduceXorOpAdaptor(VPReduceXorOp op) : VPReduceXorOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPReduceXorOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPReduceXorOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPReduceXorOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPReduceXorOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPReduceXorOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPReduceXorOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPReduceXorOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPReduceXorOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPReduceXorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPReduceXorOp VPReduceXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceXorOp VPReduceXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceXorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(satrt_value);
odsState.addOperands(val);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPReduceXorOp VPReduceXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPReduceXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceXorOp VPReduceXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value satrt_value, ::mlir::Value val, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(satrt_value)>(satrt_value), std::forward<decltype(val)>(val), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPReduceXorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceXorOp VPReduceXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPReduceXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceXorOp VPReduceXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPReduceXorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPReduceXorOp VPReduceXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPReduceXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPReduceXorOp VPReduceXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPReduceXorOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPReduceXorOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPReduceXorOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPReduceXorOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPReduceXorOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSDivOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSDivOpGenericAdaptorBase::VPSDivOpGenericAdaptorBase(VPSDivOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSDivOpAdaptor::VPSDivOpAdaptor(VPSDivOp op) : VPSDivOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSDivOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSDivOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSDivOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSDivOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSDivOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSDivOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSDivOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSDivOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSDivOp VPSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSDivOp VPSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSDivOp VPSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSDivOp VPSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSDivOp VPSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSDivOp VPSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSDivOp VPSDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSDivOp VPSDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSDivOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSDivOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSDivOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSDivOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSDivOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSExtOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSExtOpGenericAdaptorBase::VPSExtOpGenericAdaptorBase(VPSExtOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSExtOpAdaptor::VPSExtOpAdaptor(VPSExtOp op) : VPSExtOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSExtOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSExtOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSExtOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSExtOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSExtOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSExtOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSExtOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSExtOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSExtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSExtOp VPSExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSExtOp VPSExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSExtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSExtOp VPSExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSExtOp VPSExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSExtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSExtOp VPSExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSExtOp VPSExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSExtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSExtOp VPSExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSExtOp VPSExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSExtOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSExtOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSExtOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSExtOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSExtOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSIToFPOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSIToFPOpGenericAdaptorBase::VPSIToFPOpGenericAdaptorBase(VPSIToFPOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSIToFPOpAdaptor::VPSIToFPOpAdaptor(VPSIToFPOp op) : VPSIToFPOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSIToFPOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSIToFPOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSIToFPOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSIToFPOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSIToFPOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSIToFPOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSIToFPOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSIToFPOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSIToFPOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSIToFPOp VPSIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSIToFPOp VPSIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSIToFPOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSIToFPOp VPSIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSIToFPOp VPSIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSIToFPOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSIToFPOp VPSIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSIToFPOp VPSIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSIToFPOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSIToFPOp VPSIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSIToFPOp VPSIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSIToFPOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSIToFPOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSIToFPOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSIToFPOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSIToFPOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSMaxOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSMaxOpGenericAdaptorBase::VPSMaxOpGenericAdaptorBase(VPSMaxOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSMaxOpAdaptor::VPSMaxOpAdaptor(VPSMaxOp op) : VPSMaxOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSMaxOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSMaxOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSMaxOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSMaxOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSMaxOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSMaxOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSMaxOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSMaxOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSMaxOp VPSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMaxOp VPSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSMaxOp VPSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMaxOp VPSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSMaxOp VPSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMaxOp VPSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSMaxOp VPSMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMaxOp VPSMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSMaxOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSMaxOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSMaxOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSMaxOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSMaxOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSMinOpGenericAdaptorBase::VPSMinOpGenericAdaptorBase(VPSMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSMinOpAdaptor::VPSMinOpAdaptor(VPSMinOp op) : VPSMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSMinOp VPSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMinOp VPSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSMinOp VPSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMinOp VPSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSMinOp VPSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMinOp VPSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSMinOp VPSMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSMinOp VPSMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSMinOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSRemOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSRemOpGenericAdaptorBase::VPSRemOpGenericAdaptorBase(VPSRemOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSRemOpAdaptor::VPSRemOpAdaptor(VPSRemOp op) : VPSRemOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSRemOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSRemOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSRemOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSRemOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSRemOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSRemOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSRemOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSRemOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSRemOp VPSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSRemOp VPSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSRemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSRemOp VPSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSRemOp VPSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSRemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSRemOp VPSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSRemOp VPSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSRemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSRemOp VPSRemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSRemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSRemOp VPSRemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSRemOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSRemOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSRemOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSRemOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSRemOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSelectMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSelectMinOpGenericAdaptorBase::VPSelectMinOpGenericAdaptorBase(VPSelectMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSelectMinOpAdaptor::VPSelectMinOpAdaptor(VPSelectMinOp op) : VPSelectMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSelectMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSelectMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSelectMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSelectMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSelectMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSelectMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSelectMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSelectMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSelectMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
odsState.addOperands(cond);
odsState.addOperands(true_val);
odsState.addOperands(false_val);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSelectMinOp VPSelectMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSelectMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSelectMinOp VPSelectMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
}
void VPSelectMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
odsState.addOperands(cond);
odsState.addOperands(true_val);
odsState.addOperands(false_val);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSelectMinOp VPSelectMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSelectMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSelectMinOp VPSelectMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value cond, ::mlir::Value true_val, ::mlir::Value false_val, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(cond)>(cond), std::forward<decltype(true_val)>(true_val), std::forward<decltype(false_val)>(false_val), std::forward<decltype(evl)>(evl));
}
void VPSelectMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSelectMinOp VPSelectMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSelectMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSelectMinOp VPSelectMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSelectMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSelectMinOp VPSelectMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSelectMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSelectMinOp VPSelectMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSelectMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSelectMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSelectMinOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSelectMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSelectMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPShlOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPShlOpGenericAdaptorBase::VPShlOpGenericAdaptorBase(VPShlOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPShlOpAdaptor::VPShlOpAdaptor(VPShlOp op) : VPShlOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPShlOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPShlOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPShlOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPShlOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPShlOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPShlOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPShlOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPShlOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPShlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPShlOp VPShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPShlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPShlOp VPShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPShlOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPShlOp VPShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPShlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPShlOp VPShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPShlOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPShlOp VPShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPShlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPShlOp VPShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPShlOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPShlOp VPShlOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPShlOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPShlOp VPShlOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPShlOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPShlOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPShlOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPShlOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPShlOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPStoreOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPStoreOpGenericAdaptorBase::VPStoreOpGenericAdaptorBase(VPStoreOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPStoreOpAdaptor::VPStoreOpAdaptor(VPStoreOp op) : VPStoreOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPStoreOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPStoreOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPStoreOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPStoreOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPStoreOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPStoreOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPStoreOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPStoreOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(val);
odsState.addOperands(ptr);
odsState.addOperands(mask);
odsState.addOperands(evl);
}
VPStoreOp VPStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStoreOp VPStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(val);
odsState.addOperands(ptr);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPStoreOp VPStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStoreOp VPStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPStoreOp VPStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStoreOp VPStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPStoreOp VPStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStoreOp VPStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPStoreOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPStoreOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPStoreOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPStoreOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPStridedLoadOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPStridedLoadOpGenericAdaptorBase::VPStridedLoadOpGenericAdaptorBase(VPStridedLoadOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPStridedLoadOpAdaptor::VPStridedLoadOpAdaptor(VPStridedLoadOp op) : VPStridedLoadOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPStridedLoadOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPStridedLoadOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPStridedLoadOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPStridedLoadOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPStridedLoadOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPStridedLoadOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPStridedLoadOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPStridedLoadOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPStridedLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(ptr);
odsState.addOperands(stride);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPStridedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPStridedLoadOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(ptr);
odsState.addOperands(stride);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPStridedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPStridedLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPStridedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPStridedLoadOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPStridedLoadOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedLoadOp VPStridedLoadOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPStridedLoadOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPStridedLoadOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPStridedLoadOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPStridedLoadOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPStridedStoreOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPStridedStoreOpGenericAdaptorBase::VPStridedStoreOpGenericAdaptorBase(VPStridedStoreOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPStridedStoreOpAdaptor::VPStridedStoreOpAdaptor(VPStridedStoreOp op) : VPStridedStoreOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPStridedStoreOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPStridedStoreOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPStridedStoreOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPStridedStoreOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPStridedStoreOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPStridedStoreOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPStridedStoreOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPStridedStoreOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPStridedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(val);
odsState.addOperands(ptr);
odsState.addOperands(stride);
odsState.addOperands(mask);
odsState.addOperands(evl);
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPStridedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPStridedStoreOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(val);
odsState.addOperands(ptr);
odsState.addOperands(stride);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPStridedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value ptr, ::mlir::Value stride, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(ptr)>(ptr), std::forward<decltype(stride)>(stride), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPStridedStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPStridedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPStridedStoreOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPStridedStoreOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPStridedStoreOp VPStridedStoreOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPStridedStoreOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps4(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup4 = getODSOperands(4);
for (auto v : valueGroup4) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPStridedStoreOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPStridedStoreOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPStridedStoreOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPSubOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPSubOpGenericAdaptorBase::VPSubOpGenericAdaptorBase(VPSubOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPSubOpAdaptor::VPSubOpAdaptor(VPSubOp op) : VPSubOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPSubOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPSubOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPSubOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPSubOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPSubOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPSubOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPSubOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPSubOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPSubOp VPSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSubOp VPSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSubOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPSubOp VPSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSubOp VPSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSubOp VPSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSubOp VPSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPSubOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPSubOp VPSubOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPSubOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPSubOp VPSubOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPSubOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPSubOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPSubOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPSubOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPSubOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPTruncOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPTruncOpGenericAdaptorBase::VPTruncOpGenericAdaptorBase(VPTruncOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPTruncOpAdaptor::VPTruncOpAdaptor(VPTruncOp op) : VPTruncOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPTruncOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPTruncOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPTruncOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPTruncOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPTruncOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPTruncOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPTruncOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPTruncOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPTruncOp VPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPTruncOp VPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPTruncOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPTruncOp VPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPTruncOp VPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPTruncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPTruncOp VPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPTruncOp VPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPTruncOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPTruncOp VPTruncOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPTruncOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPTruncOp VPTruncOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPTruncOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPTruncOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPTruncOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPTruncOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPTruncOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPUDivOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPUDivOpGenericAdaptorBase::VPUDivOpGenericAdaptorBase(VPUDivOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPUDivOpAdaptor::VPUDivOpAdaptor(VPUDivOp op) : VPUDivOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPUDivOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPUDivOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPUDivOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPUDivOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPUDivOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPUDivOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPUDivOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPUDivOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPUDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPUDivOp VPUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUDivOp VPUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUDivOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPUDivOp VPUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUDivOp VPUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUDivOp VPUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPUDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUDivOp VPUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPUDivOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUDivOp VPUDivOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPUDivOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUDivOp VPUDivOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPUDivOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPUDivOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPUDivOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPUDivOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPUDivOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPUIToFPOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPUIToFPOpGenericAdaptorBase::VPUIToFPOpGenericAdaptorBase(VPUIToFPOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPUIToFPOpAdaptor::VPUIToFPOpAdaptor(VPUIToFPOp op) : VPUIToFPOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPUIToFPOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPUIToFPOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPUIToFPOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPUIToFPOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPUIToFPOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPUIToFPOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPUIToFPOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPUIToFPOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPUIToFPOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPUIToFPOp VPUIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUIToFPOp VPUIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUIToFPOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPUIToFPOp VPUIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUIToFPOp VPUIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUIToFPOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUIToFPOp VPUIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPUIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUIToFPOp VPUIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPUIToFPOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUIToFPOp VPUIToFPOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPUIToFPOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUIToFPOp VPUIToFPOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPUIToFPOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPUIToFPOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPUIToFPOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPUIToFPOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPUIToFPOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPUMaxOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPUMaxOpGenericAdaptorBase::VPUMaxOpGenericAdaptorBase(VPUMaxOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPUMaxOpAdaptor::VPUMaxOpAdaptor(VPUMaxOp op) : VPUMaxOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPUMaxOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPUMaxOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPUMaxOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPUMaxOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPUMaxOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPUMaxOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPUMaxOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPUMaxOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPUMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPUMaxOp VPUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMaxOp VPUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUMaxOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPUMaxOp VPUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMaxOp VPUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUMaxOp VPUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMaxOp VPUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPUMaxOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUMaxOp VPUMaxOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPUMaxOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMaxOp VPUMaxOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPUMaxOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPUMaxOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPUMaxOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPUMaxOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPUMaxOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPUMinOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPUMinOpGenericAdaptorBase::VPUMinOpGenericAdaptorBase(VPUMinOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPUMinOpAdaptor::VPUMinOpAdaptor(VPUMinOp op) : VPUMinOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPUMinOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPUMinOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPUMinOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPUMinOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPUMinOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPUMinOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPUMinOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPUMinOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPUMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPUMinOp VPUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMinOp VPUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUMinOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPUMinOp VPUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMinOp VPUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPUMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUMinOp VPUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMinOp VPUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPUMinOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPUMinOp VPUMinOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPUMinOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPUMinOp VPUMinOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPUMinOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPUMinOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPUMinOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPUMinOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPUMinOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPURemOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPURemOpGenericAdaptorBase::VPURemOpGenericAdaptorBase(VPURemOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPURemOpAdaptor::VPURemOpAdaptor(VPURemOp op) : VPURemOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPURemOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPURemOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPURemOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPURemOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPURemOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPURemOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPURemOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPURemOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPURemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPURemOp VPURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPURemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPURemOp VPURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPURemOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPURemOp VPURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPURemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPURemOp VPURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPURemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPURemOp VPURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPURemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPURemOp VPURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPURemOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPURemOp VPURemOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPURemOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPURemOp VPURemOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPURemOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPURemOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPURemOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPURemOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPURemOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPXorOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPXorOpGenericAdaptorBase::VPXorOpGenericAdaptorBase(VPXorOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPXorOpAdaptor::VPXorOpAdaptor(VPXorOp op) : VPXorOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPXorOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPXorOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPXorOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPXorOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPXorOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPXorOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPXorOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPXorOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPXorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPXorOp VPXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPXorOp VPXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPXorOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(lhs);
odsState.addOperands(rhs);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPXorOp VPXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPXorOp VPXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(lhs)>(lhs), std::forward<decltype(rhs)>(rhs), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPXorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPXorOp VPXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPXorOp VPXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPXorOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 4u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPXorOp VPXorOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPXorOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPXorOp VPXorOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPXorOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPXorOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPXorOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPXorOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPXorOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VPZExtOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VPZExtOpGenericAdaptorBase::VPZExtOpGenericAdaptorBase(VPZExtOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VPZExtOpAdaptor::VPZExtOpAdaptor(VPZExtOp op) : VPZExtOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VPZExtOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VPZExtOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VPZExtOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VPZExtOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VPZExtOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VPZExtOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VPZExtOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VPZExtOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VPZExtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
odsState.addTypes(res);
}
VPZExtOp VPZExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPZExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPZExtOp VPZExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPZExtOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
odsState.addOperands(src);
odsState.addOperands(mask);
odsState.addOperands(evl);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VPZExtOp VPZExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
auto __res__ = ::llvm::dyn_cast<VPZExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPZExtOp VPZExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value src, ::mlir::Value mask, ::mlir::Value evl) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(src)>(src), std::forward<decltype(mask)>(mask), std::forward<decltype(evl)>(evl));
}
void VPZExtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPZExtOp VPZExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VPZExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPZExtOp VPZExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VPZExtOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VPZExtOp VPZExtOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VPZExtOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VPZExtOp VPZExtOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VPZExtOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VPZExtOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VPZExtOp::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void VPZExtOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VPZExtOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VaCopyOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VaCopyOpGenericAdaptorBase::VaCopyOpGenericAdaptorBase(VaCopyOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VaCopyOpAdaptor::VaCopyOpAdaptor(VaCopyOp op) : VaCopyOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VaCopyOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VaCopyOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VaCopyOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VaCopyOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VaCopyOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VaCopyOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VaCopyOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VaCopyOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VaCopyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dest_list, ::mlir::Value src_list) {
odsState.addOperands(dest_list);
odsState.addOperands(src_list);
}
VaCopyOp VaCopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dest_list, ::mlir::Value src_list) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dest_list)>(dest_list), std::forward<decltype(src_list)>(src_list));
auto __res__ = ::llvm::dyn_cast<VaCopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaCopyOp VaCopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dest_list, ::mlir::Value src_list) {
return create(builder, builder.getLoc(), std::forward<decltype(dest_list)>(dest_list), std::forward<decltype(src_list)>(src_list));
}
void VaCopyOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dest_list, ::mlir::Value src_list) {
odsState.addOperands(dest_list);
odsState.addOperands(src_list);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VaCopyOp VaCopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dest_list, ::mlir::Value src_list) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dest_list)>(dest_list), std::forward<decltype(src_list)>(src_list));
auto __res__ = ::llvm::dyn_cast<VaCopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaCopyOp VaCopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dest_list, ::mlir::Value src_list) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dest_list)>(dest_list), std::forward<decltype(src_list)>(src_list));
}
void VaCopyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VaCopyOp VaCopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VaCopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaCopyOp VaCopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VaCopyOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VaCopyOp VaCopyOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VaCopyOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaCopyOp VaCopyOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VaCopyOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VaCopyOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult VaCopyOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand src_listRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> src_listOperands(&src_listRawOperand, 1); ::llvm::SMLoc src_listOperandsLoc;
(void)src_listOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand dest_listRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> dest_listOperands(&dest_listRawOperand, 1); ::llvm::SMLoc dest_listOperandsLoc;
(void)dest_listOperandsLoc;
::llvm::SmallVector<::mlir::Type, 1> allOperandTypes;
src_listOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(src_listRawOperand))
return ::mlir::failure();
if (parser.parseKeyword("to"))
return ::mlir::failure();
dest_listOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(dest_listRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseTypeList(allOperandTypes))
return ::mlir::failure();
if (parser.resolveOperands(::llvm::concat<const ::mlir::OpAsmParser::UnresolvedOperand>(dest_listOperands, src_listOperands), allOperandTypes, parser.getNameLoc(), result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void VaCopyOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getSrcList();
_odsPrinter << ' ' << "to";
_odsPrinter << ' ';
_odsPrinter << getDestList();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getOperation()->getOperandTypes();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VaCopyOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VaEndOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VaEndOpGenericAdaptorBase::VaEndOpGenericAdaptorBase(VaEndOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VaEndOpAdaptor::VaEndOpAdaptor(VaEndOp op) : VaEndOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VaEndOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VaEndOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VaEndOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VaEndOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VaEndOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VaEndOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VaEndOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VaEndOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VaEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_list) {
odsState.addOperands(arg_list);
}
VaEndOp VaEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_list) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_list)>(arg_list));
auto __res__ = ::llvm::dyn_cast<VaEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaEndOp VaEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_list) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_list)>(arg_list));
}
void VaEndOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_list) {
odsState.addOperands(arg_list);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VaEndOp VaEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_list) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_list)>(arg_list));
auto __res__ = ::llvm::dyn_cast<VaEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaEndOp VaEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_list) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_list)>(arg_list));
}
void VaEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VaEndOp VaEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VaEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaEndOp VaEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VaEndOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VaEndOp VaEndOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VaEndOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaEndOp VaEndOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VaEndOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VaEndOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult VaEndOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_listRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_listOperands(&arg_listRawOperand, 1); ::llvm::SMLoc arg_listOperandsLoc;
(void)arg_listOperandsLoc;
::mlir::Type arg_listRawType{};
::llvm::ArrayRef<::mlir::Type> arg_listTypes(&arg_listRawType, 1);
arg_listOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_listRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(arg_listRawType))
return ::mlir::failure();
if (parser.resolveOperands(arg_listOperands, arg_listTypes, arg_listOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void VaEndOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArgList();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getArgList().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VaEndOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VaStartOp definitions
//===----------------------------------------------------------------------===//
namespace detail {
VaStartOpGenericAdaptorBase::VaStartOpGenericAdaptorBase(VaStartOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VaStartOpAdaptor::VaStartOpAdaptor(VaStartOp op) : VaStartOpGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VaStartOpAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VaStartOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VaStartOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VaStartOp::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VaStartOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VaStartOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VaStartOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VaStartOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VaStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arg_list) {
odsState.addOperands(arg_list);
}
VaStartOp VaStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arg_list) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(arg_list)>(arg_list));
auto __res__ = ::llvm::dyn_cast<VaStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaStartOp VaStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value arg_list) {
return create(builder, builder.getLoc(), std::forward<decltype(arg_list)>(arg_list));
}
void VaStartOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arg_list) {
odsState.addOperands(arg_list);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VaStartOp VaStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arg_list) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_list)>(arg_list));
auto __res__ = ::llvm::dyn_cast<VaStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaStartOp VaStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arg_list) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(arg_list)>(arg_list));
}
void VaStartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VaStartOp VaStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VaStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaStartOp VaStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VaStartOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VaStartOp VaStartOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VaStartOp>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VaStartOp VaStartOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VaStartOp::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult VaStartOp::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult VaStartOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand arg_listRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arg_listOperands(&arg_listRawOperand, 1); ::llvm::SMLoc arg_listOperandsLoc;
(void)arg_listOperandsLoc;
::mlir::Type arg_listRawType{};
::llvm::ArrayRef<::mlir::Type> arg_listTypes(&arg_listRawType, 1);
arg_listOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(arg_listRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
if (parser.parseType(arg_listRawType))
return ::mlir::failure();
if (parser.resolveOperands(arg_listOperands, arg_listTypes, arg_listOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void VaStartOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getArgList();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter << getArgList().getType();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VaStartOp)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::VarAnnotation definitions
//===----------------------------------------------------------------------===//
namespace detail {
VarAnnotationGenericAdaptorBase::VarAnnotationGenericAdaptorBase(VarAnnotation op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
VarAnnotationAdaptor::VarAnnotationAdaptor(VarAnnotation op) : VarAnnotationGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult VarAnnotationAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult VarAnnotation::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute VarAnnotation::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code VarAnnotation::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> VarAnnotation::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void VarAnnotation::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void VarAnnotation::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult VarAnnotation::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void VarAnnotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value val, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
odsState.addOperands(val);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
odsState.addOperands(attr);
}
VarAnnotation VarAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value val, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(val)>(val), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
auto __res__ = ::llvm::dyn_cast<VarAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VarAnnotation VarAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value val, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
return create(builder, builder.getLoc(), std::forward<decltype(val)>(val), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
}
void VarAnnotation::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
odsState.addOperands(val);
odsState.addOperands(annotation);
odsState.addOperands(fileName);
odsState.addOperands(line);
odsState.addOperands(attr);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
VarAnnotation VarAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
auto __res__ = ::llvm::dyn_cast<VarAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VarAnnotation VarAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value val, ::mlir::Value annotation, ::mlir::Value fileName, ::mlir::Value line, ::mlir::Value attr) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(val)>(val), std::forward<decltype(annotation)>(annotation), std::forward<decltype(fileName)>(fileName), std::forward<decltype(line)>(line), std::forward<decltype(attr)>(attr));
}
void VarAnnotation::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VarAnnotation VarAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<VarAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VarAnnotation VarAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void VarAnnotation::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 5u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
VarAnnotation VarAnnotation::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<VarAnnotation>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
VarAnnotation VarAnnotation::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult VarAnnotation::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup3 = getODSOperands(3);
for (auto v : valueGroup3) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps6(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup4 = getODSOperands(4);
for (auto v : valueGroup4) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
if (!((((*this->getODSOperands(1).begin()).getType()) == ((*this->getODSOperands(2).begin()).getType()) && ((*this->getODSOperands(2).begin()).getType()) == ((*this->getODSOperands(4).begin()).getType()) && ((*this->getODSOperands(4).begin()).getType()) == ((*this->getODSOperands(1).begin()).getType()))))
return emitOpError("failed to verify that all of {annotation, fileName, attr} have same type");
return ::mlir::success();
}
::llvm::LogicalResult VarAnnotation::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult VarAnnotation::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::VarAnnotation)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::masked_compressstore definitions
//===----------------------------------------------------------------------===//
namespace detail {
masked_compressstoreGenericAdaptorBase::masked_compressstoreGenericAdaptorBase(masked_compressstore op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::std::optional< ::mlir::ArrayAttr > masked_compressstoreGenericAdaptorBase::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > masked_compressstoreGenericAdaptorBase::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
masked_compressstoreAdaptor::masked_compressstoreAdaptor(masked_compressstore op) : masked_compressstoreGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult masked_compressstoreAdaptor::verify(::mlir::Location loc) {
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.masked.compressstore' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.masked.compressstore' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
return ::mlir::success();
}
::llvm::LogicalResult masked_compressstore::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.arg_attrs;
auto attr = dict.get("arg_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto attr = dict.get("res_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute masked_compressstore::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.arg_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
propStorage));
}
{
const auto &propStorage = prop.res_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code masked_compressstore::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.res_attrs.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> masked_compressstore::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "arg_attrs")
return prop.arg_attrs;
if (name == "res_attrs")
return prop.res_attrs;
return std::nullopt;
}
void masked_compressstore::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "arg_attrs") {
prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
return;
}
if (name == "res_attrs") {
prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
return;
}
}
void masked_compressstore::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
}
::llvm::LogicalResult masked_compressstore::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "arg_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "res_attrs", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult masked_compressstore::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
return ::mlir::failure();
return ::mlir::success();
}
void masked_compressstore::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.arg_attrs);
writer.writeOptionalAttribute(prop.res_attrs);
}
::std::optional< ::mlir::ArrayAttr > masked_compressstore::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > masked_compressstore::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
masked_compressstore masked_compressstore::create(::mlir::OpBuilder &builder, ::mlir::Location location, Value value, Value ptr, Value mask, uint64_t align) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(align)>(align));
auto __res__ = ::llvm::dyn_cast<masked_compressstore>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_compressstore masked_compressstore::create(::mlir::ImplicitLocOpBuilder &builder, Value value, Value ptr, Value mask, uint64_t align) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(align)>(align));
}
void masked_compressstore::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value, ::mlir::Value ptr, ::mlir::Value mask, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(value);
odsState.addOperands(ptr);
odsState.addOperands(mask);
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
}
masked_compressstore masked_compressstore::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value, ::mlir::Value ptr, ::mlir::Value mask, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<masked_compressstore>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_compressstore masked_compressstore::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value, ::mlir::Value ptr, ::mlir::Value mask, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void masked_compressstore::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptr, ::mlir::Value mask, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(value);
odsState.addOperands(ptr);
odsState.addOperands(mask);
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
masked_compressstore masked_compressstore::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptr, ::mlir::Value mask, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<masked_compressstore>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_compressstore masked_compressstore::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptr, ::mlir::Value mask, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void masked_compressstore::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<masked_compressstore::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
masked_compressstore masked_compressstore::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<masked_compressstore>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_compressstore masked_compressstore::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void masked_compressstore::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
masked_compressstore masked_compressstore::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<masked_compressstore>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_compressstore masked_compressstore::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult masked_compressstore::verifyInvariantsImpl() {
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_arg_attrs, "arg_attrs")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_res_attrs, "res_attrs")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult masked_compressstore::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult masked_compressstore::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.arg_attrs;
auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx, "arg_attrs");
auto attr = dict.get(arg_attrsAttrName);
usedKeys.insert(arg_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for arg_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto res_attrsAttrName = ::mlir::StringAttr::get(ctx, "res_attrs");
auto attr = dict.get(res_attrsAttrName);
usedKeys.insert(res_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for res_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::masked_compressstore)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::masked_compressstoreGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::masked_expandload definitions
//===----------------------------------------------------------------------===//
namespace detail {
masked_expandloadGenericAdaptorBase::masked_expandloadGenericAdaptorBase(masked_expandload op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::std::optional< ::mlir::ArrayAttr > masked_expandloadGenericAdaptorBase::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > masked_expandloadGenericAdaptorBase::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
} // namespace detail
masked_expandloadAdaptor::masked_expandloadAdaptor(masked_expandload op) : masked_expandloadGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult masked_expandloadAdaptor::verify(::mlir::Location loc) {
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
if (tblgen_arg_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_arg_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_arg_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.masked.expandload' op attribute 'arg_attrs' failed to satisfy constraint: Array of dictionary attributes");
if (tblgen_res_attrs && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_res_attrs))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_res_attrs), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::DictionaryAttr>(attr))); }))))
return emitError(loc, "'llvm.intr.masked.expandload' op attribute 'res_attrs' failed to satisfy constraint: Array of dictionary attributes");
return ::mlir::success();
}
::llvm::LogicalResult masked_expandload::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.arg_attrs;
auto attr = dict.get("arg_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto attr = dict.get("res_attrs");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute masked_expandload::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.arg_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("arg_attrs",
propStorage));
}
{
const auto &propStorage = prop.res_attrs;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("res_attrs",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code masked_expandload::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.arg_attrs.getAsOpaquePointer()),
llvm::hash_value(prop.res_attrs.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> masked_expandload::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "arg_attrs")
return prop.arg_attrs;
if (name == "res_attrs")
return prop.res_attrs;
return std::nullopt;
}
void masked_expandload::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "arg_attrs") {
prop.arg_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.arg_attrs)>>(value);
return;
}
if (name == "res_attrs") {
prop.res_attrs = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.res_attrs)>>(value);
return;
}
}
void masked_expandload::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.arg_attrs) attrs.append("arg_attrs", prop.arg_attrs);
if (prop.res_attrs) attrs.append("res_attrs", prop.res_attrs);
}
::llvm::LogicalResult masked_expandload::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getArgAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "arg_attrs", emitError)))
return ::mlir::failure();
}
{
::mlir::Attribute attr = attrs.get(getResAttrsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(attr, "res_attrs", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult masked_expandload::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.arg_attrs)))
return ::mlir::failure();
if (::mlir::failed(reader.readOptionalAttribute(prop.res_attrs)))
return ::mlir::failure();
return ::mlir::success();
}
void masked_expandload::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.arg_attrs);
writer.writeOptionalAttribute(prop.res_attrs);
}
::std::optional< ::mlir::ArrayAttr > masked_expandload::getArgAttrs() {
auto attr = getArgAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
::std::optional< ::mlir::ArrayAttr > masked_expandload::getResAttrs() {
auto attr = getResAttrsAttr();
return attr ? ::std::optional< ::mlir::ArrayAttr >(attr) : (::std::nullopt);
}
masked_expandload masked_expandload::create(::mlir::OpBuilder &builder, ::mlir::Location location, TypeRange resTy, Value ptr, Value mask, Value passthru, uint64_t align) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resTy)>(resTy), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(passthru)>(passthru), std::forward<decltype(align)>(align));
auto __res__ = ::llvm::dyn_cast<masked_expandload>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_expandload masked_expandload::create(::mlir::ImplicitLocOpBuilder &builder, TypeRange resTy, Value ptr, Value mask, Value passthru, uint64_t align) {
return create(builder, builder.getLoc(), std::forward<decltype(resTy)>(resTy), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(passthru)>(passthru), std::forward<decltype(align)>(align));
}
void masked_expandload::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value passthru, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(ptr);
odsState.addOperands(mask);
odsState.addOperands(passthru);
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
odsState.addTypes(res);
}
masked_expandload masked_expandload::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value passthru, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(passthru)>(passthru), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<masked_expandload>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_expandload masked_expandload::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value passthru, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(passthru)>(passthru), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void masked_expandload::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value passthru, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
odsState.addOperands(ptr);
odsState.addOperands(mask);
odsState.addOperands(passthru);
if (arg_attrs) {
odsState.getOrAddProperties<Properties>().arg_attrs = arg_attrs;
}
if (res_attrs) {
odsState.getOrAddProperties<Properties>().res_attrs = res_attrs;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
masked_expandload masked_expandload::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value passthru, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(passthru)>(passthru), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
auto __res__ = ::llvm::dyn_cast<masked_expandload>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_expandload masked_expandload::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptr, ::mlir::Value mask, ::mlir::Value passthru, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptr)>(ptr), std::forward<decltype(mask)>(mask), std::forward<decltype(passthru)>(passthru), std::forward<decltype(arg_attrs)>(arg_attrs), std::forward<decltype(res_attrs)>(res_attrs));
}
void masked_expandload::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<masked_expandload::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
masked_expandload masked_expandload::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<masked_expandload>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_expandload masked_expandload::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void masked_expandload::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
masked_expandload masked_expandload::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<masked_expandload>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_expandload masked_expandload::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult masked_expandload::verifyInvariantsImpl() {
auto tblgen_arg_attrs = getProperties().arg_attrs; (void)tblgen_arg_attrs;
auto tblgen_res_attrs = getProperties().res_attrs; (void)tblgen_res_attrs;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_arg_attrs, "arg_attrs")))
return ::mlir::failure();
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps18(*this, tblgen_res_attrs, "res_attrs")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps5(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult masked_expandload::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult masked_expandload::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.arg_attrs;
auto arg_attrsAttrName = ::mlir::StringAttr::get(ctx, "arg_attrs");
auto attr = dict.get(arg_attrsAttrName);
usedKeys.insert(arg_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for arg_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `arg_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
{
auto &propStorage = prop.res_attrs;
auto res_attrsAttrName = ::mlir::StringAttr::get(ctx, "res_attrs");
auto attr = dict.get(res_attrsAttrName);
usedKeys.insert(res_attrsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for res_attrs in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `res_attrs` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::masked_expandload)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::masked_expandloadGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::masked_gather definitions
//===----------------------------------------------------------------------===//
namespace detail {
masked_gatherGenericAdaptorBase::masked_gatherGenericAdaptorBase(masked_gather op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
std::pair<unsigned, unsigned> masked_gatherGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
bool isVariadic[] = {false, false, true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (odsOperandsSize - 2) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
uint32_t masked_gatherGenericAdaptorBase::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
masked_gatherAdaptor::masked_gatherAdaptor(masked_gather op) : masked_gatherGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult masked_gatherAdaptor::verify(::mlir::Location loc) {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitError(loc, "'llvm.intr.masked.gather' op requires attribute 'alignment'");
if (tblgen_alignment && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_alignment))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_alignment).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.masked.gather' op attribute 'alignment' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
std::pair<unsigned, unsigned> masked_gather::getODSOperandIndexAndLength(unsigned index) {
bool isVariadic[] = {false, false, true};
int prevVariadicCount = 0;
for (unsigned i = 0; i < index; ++i)
if (isVariadic[i]) ++prevVariadicCount;
// Calculate how many dynamic values a static variadic operand corresponds to.
// This assumes all static variadic operands have the same dynamic value count.
int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
// `index` passed in as the parameter is the static index which counts each
// operand (variadic or not) as size 1. So here for each previous static variadic
// operand, we need to offset by (variadicSize - 1) to get where the dynamic
// value pack for this static operand starts.
int start = index + (variadicSize - 1) * prevVariadicCount;
int size = isVariadic[index] ? variadicSize : 1;
return {start, size};
}
::mlir::MutableOperandRange masked_gather::getPassThruMutable() {
auto range = getODSOperandIndexAndLength(2);
auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
return mutableRange;
}
::llvm::LogicalResult masked_gather::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.alignment;
auto attr = dict.get("alignment");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alignment` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute masked_gather::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.alignment;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alignment",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code masked_gather::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.alignment.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> masked_gather::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "alignment")
return prop.alignment;
return std::nullopt;
}
void masked_gather::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "alignment") {
prop.alignment = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alignment)>>(value);
return;
}
}
void masked_gather::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.alignment) attrs.append("alignment", prop.alignment);
}
::llvm::LogicalResult masked_gather::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAlignmentAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "alignment", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult masked_gather::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.alignment)))
return ::mlir::failure();
return ::mlir::success();
}
void masked_gather::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.alignment);
}
uint32_t masked_gather::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
void masked_gather::setAlignment(uint32_t attrValue) {
getProperties().alignment = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void masked_gather::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
if (resultType) odsState.addTypes(resultType);
odsState.addOperands(operands);
for (auto namedAttr : attributes)
odsState.addAttribute(namedAttr.getName(), namedAttr.getValue());
}
masked_gather masked_gather::create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<masked_gather>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_gather masked_gather::create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void masked_gather::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, ::mlir::IntegerAttr alignment) {
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = alignment;
odsState.addTypes(res);
}
masked_gather masked_gather::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, ::mlir::IntegerAttr alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_gather>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_gather masked_gather::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, ::mlir::IntegerAttr alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
}
void masked_gather::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, ::mlir::IntegerAttr alignment) {
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = alignment;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
masked_gather masked_gather::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, ::mlir::IntegerAttr alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_gather>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_gather masked_gather::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, ::mlir::IntegerAttr alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
}
void masked_gather::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, uint32_t alignment) {
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
odsState.addTypes(res);
}
masked_gather masked_gather::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, uint32_t alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_gather>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_gather masked_gather::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, uint32_t alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
}
void masked_gather::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, uint32_t alignment) {
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.addOperands(pass_thru);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
masked_gather masked_gather::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, uint32_t alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_gather>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_gather masked_gather::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::ValueRange pass_thru, uint32_t alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(pass_thru)>(pass_thru), std::forward<decltype(alignment)>(alignment));
}
void masked_gather::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() >= 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<masked_gather::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
masked_gather masked_gather::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<masked_gather>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_gather masked_gather::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void masked_gather::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() >= 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
masked_gather masked_gather::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<masked_gather>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_gather masked_gather::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult masked_gather::verifyInvariantsImpl() {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitOpError("requires attribute 'alignment'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_alignment, "alignment")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps20(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps22(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult masked_gather::verifyInvariants() {
if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
return ::mlir::success();
return ::mlir::failure();
}
::mlir::ParseResult masked_gather::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void masked_gather::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getOperation()->getOperands();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::masked_gather)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::masked_gatherGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::masked_scatter definitions
//===----------------------------------------------------------------------===//
namespace detail {
masked_scatterGenericAdaptorBase::masked_scatterGenericAdaptorBase(masked_scatter op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint32_t masked_scatterGenericAdaptorBase::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
masked_scatterAdaptor::masked_scatterAdaptor(masked_scatter op) : masked_scatterGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult masked_scatterAdaptor::verify(::mlir::Location loc) {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitError(loc, "'llvm.intr.masked.scatter' op requires attribute 'alignment'");
if (tblgen_alignment && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_alignment))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_alignment).getType().isSignlessInteger(32)))))
return emitError(loc, "'llvm.intr.masked.scatter' op attribute 'alignment' failed to satisfy constraint: 32-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult masked_scatter::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.alignment;
auto attr = dict.get("alignment");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `alignment` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute masked_scatter::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.alignment;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("alignment",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code masked_scatter::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.alignment.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> masked_scatter::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "alignment")
return prop.alignment;
return std::nullopt;
}
void masked_scatter::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "alignment") {
prop.alignment = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.alignment)>>(value);
return;
}
}
void masked_scatter::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.alignment) attrs.append("alignment", prop.alignment);
}
::llvm::LogicalResult masked_scatter::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getAlignmentAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(attr, "alignment", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult masked_scatter::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.alignment)))
return ::mlir::failure();
return ::mlir::success();
}
void masked_scatter::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.alignment);
}
uint32_t masked_scatter::getAlignment() {
auto attr = getAlignmentAttr();
return attr.getValue().getZExtValue();
}
void masked_scatter::setAlignment(uint32_t attrValue) {
getProperties().alignment = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(32), attrValue);
}
void masked_scatter::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
assert(isCompatibleType(resultType) && "result must be an LLVM type");
assert(::llvm::isa<LLVMVoidType>(resultType) &&
"for zero-result operands, only 'void' is accepted as result type");
build(odsBuilder, odsState, operands, attributes);
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, Type resultType, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultType)>(resultType), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void masked_scatter::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
odsState.addOperands(operands);
for (auto namedAttr : attributes)
odsState.addAttribute(namedAttr.getName(), namedAttr.getValue());
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, ValueRange operands, ArrayRef<NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void masked_scatter::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
odsState.addOperands(value);
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = alignment;
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void masked_scatter::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
odsState.addOperands(value);
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = alignment;
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, ::mlir::IntegerAttr alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void masked_scatter::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, uint32_t alignment) {
odsState.addOperands(value);
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, uint32_t alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, uint32_t alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void masked_scatter::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, uint32_t alignment) {
odsState.addOperands(value);
odsState.addOperands(ptrs);
odsState.addOperands(mask);
odsState.getOrAddProperties<Properties>().alignment = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(32), alignment);
assert(resultTypes.size() == 0u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, uint32_t alignment) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value value, ::mlir::Value ptrs, ::mlir::Value mask, uint32_t alignment) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(value)>(value), std::forward<decltype(ptrs)>(ptrs), std::forward<decltype(mask)>(mask), std::forward<decltype(alignment)>(alignment));
}
void masked_scatter::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<masked_scatter::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void masked_scatter::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 3u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 0u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
masked_scatter masked_scatter::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<masked_scatter>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
masked_scatter masked_scatter::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult masked_scatter::verifyInvariantsImpl() {
auto tblgen_alignment = getProperties().alignment; (void)tblgen_alignment;
if (!tblgen_alignment) return emitOpError("requires attribute 'alignment'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps12(*this, tblgen_alignment, "alignment")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps20(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup2 = getODSOperands(2);
for (auto v : valueGroup2) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps12(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult masked_scatter::verifyInvariants() {
if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
return ::mlir::success();
return ::mlir::failure();
}
::mlir::ParseResult masked_scatter::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
(void)valueOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand ptrsRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> ptrsOperands(&ptrsRawOperand, 1); ::llvm::SMLoc ptrsOperandsLoc;
(void)ptrsOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand maskRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> maskOperands(&maskRawOperand, 1); ::llvm::SMLoc maskOperandsLoc;
(void)maskOperandsLoc;
::mlir::Type valueRawType{};
::llvm::ArrayRef<::mlir::Type> valueTypes(&valueRawType, 1);
::mlir::Type maskRawType{};
::llvm::ArrayRef<::mlir::Type> maskTypes(&maskRawType, 1);
::mlir::Type ptrsRawType{};
::llvm::ArrayRef<::mlir::Type> ptrsTypes(&ptrsRawType, 1);
valueOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(valueRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
ptrsOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(ptrsRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
maskOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(maskRawOperand))
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
valueRawType = type;
}
if (parser.parseComma())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
maskRawType = type;
}
if (parser.parseKeyword("into"))
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
ptrsRawType = type;
}
if (parser.resolveOperands(valueOperands, valueTypes, valueOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(ptrsOperands, ptrsTypes, ptrsOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(maskOperands, maskTypes, maskOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void masked_scatter::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getValue();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getPtrs();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getMask();
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getValue().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ",";
_odsPrinter << ' ';
{
auto type = getMask().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "into";
_odsPrinter << ' ';
{
auto type = getPtrs().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::masked_scatter)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::masked_scatterGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_deinterleave2 definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_deinterleave2GenericAdaptorBase::vector_deinterleave2GenericAdaptorBase(vector_deinterleave2 op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_deinterleave2Adaptor::vector_deinterleave2Adaptor(vector_deinterleave2 op) : vector_deinterleave2GenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_deinterleave2Adaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_deinterleave2::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_deinterleave2::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_deinterleave2::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_deinterleave2::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_deinterleave2::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_deinterleave2::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_deinterleave2::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_deinterleave2::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value vec) {
odsState.addOperands(vec);
odsState.addTypes(res);
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value vec) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(vec)>(vec));
auto __res__ = ::llvm::dyn_cast<vector_deinterleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value vec) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(vec)>(vec));
}
void vector_deinterleave2::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value vec) {
odsState.addOperands(vec);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value vec) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(vec)>(vec));
auto __res__ = ::llvm::dyn_cast<vector_deinterleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value vec) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(vec)>(vec));
}
void vector_deinterleave2::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_deinterleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_deinterleave2::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_deinterleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_deinterleave2 vector_deinterleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_deinterleave2::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_deinterleave2::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_deinterleave2::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_deinterleave2::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_deinterleave2)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_extract definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_extractGenericAdaptorBase::vector_extractGenericAdaptorBase(vector_extract op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t vector_extractGenericAdaptorBase::getPos() {
auto attr = getPosAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
vector_extractAdaptor::vector_extractAdaptor(vector_extract op) : vector_extractGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_extractAdaptor::verify(::mlir::Location loc) {
auto tblgen_pos = getProperties().pos; (void)tblgen_pos;
if (!tblgen_pos) return emitError(loc, "'llvm.intr.vector.extract' op requires attribute 'pos'");
if (tblgen_pos && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_pos))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_pos).getType().isSignlessInteger(64)))))
return emitError(loc, "'llvm.intr.vector.extract' op attribute 'pos' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult vector_extract::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.pos;
auto attr = dict.get("pos");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `pos` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_extract::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.pos;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("pos",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_extract::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.pos.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_extract::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "pos")
return prop.pos;
return std::nullopt;
}
void vector_extract::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "pos") {
prop.pos = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.pos)>>(value);
return;
}
}
void vector_extract::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.pos) attrs.append("pos", prop.pos);
}
::llvm::LogicalResult vector_extract::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getPosAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(attr, "pos", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_extract::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.pos)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_extract::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.pos);
}
uint64_t vector_extract::getPos() {
auto attr = getPosAttr();
return attr.getValue().getZExtValue();
}
void vector_extract::setPos(uint64_t attrValue) {
getProperties().pos = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void vector_extract::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = pos;
odsState.addTypes(res);
}
vector_extract vector_extract::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_extract>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_extract vector_extract::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_extract::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = pos;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_extract vector_extract::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_extract>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_extract vector_extract::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_extract::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value srcvec, uint64_t pos) {
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), pos);
odsState.addTypes(res);
}
vector_extract vector_extract::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value srcvec, uint64_t pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_extract>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_extract vector_extract::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value srcvec, uint64_t pos) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_extract::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value srcvec, uint64_t pos) {
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), pos);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_extract vector_extract::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value srcvec, uint64_t pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_extract>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_extract vector_extract::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value srcvec, uint64_t pos) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_extract::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_extract::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_extract vector_extract::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_extract>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_extract vector_extract::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_extract::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_extract vector_extract::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_extract>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_extract vector_extract::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_extract::verifyInvariantsImpl() {
auto tblgen_pos = getProperties().pos; (void)tblgen_pos;
if (!tblgen_pos) return emitOpError("requires attribute 'pos'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(*this, tblgen_pos, "pos")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!(((getSrcVectorBitWidth() <= 131072)) && ((getResVectorBitWidth() <= 131072))))
return emitOpError("failed to verify that vectors are not bigger than 2^17 bits.");
if (!((!isScalableVectorType((*this->getODSResults(0).begin()).getType()) || isScalableVectorType((*this->getODSOperands(0).begin()).getType()))))
return emitOpError("failed to verify that it is not extracting scalable from fixed-length vectors.");
return ::mlir::success();
}
::llvm::LogicalResult vector_extract::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult vector_extract::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand srcvecRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> srcvecOperands(&srcvecRawOperand, 1); ::llvm::SMLoc srcvecOperandsLoc;
(void)srcvecOperandsLoc;
::mlir::IntegerAttr posAttr;
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
::mlir::Type srcvecRawType{};
::llvm::ArrayRef<::mlir::Type> srcvecTypes(&srcvecRawType, 1);
srcvecOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(srcvecRawOperand))
return ::mlir::failure();
if (parser.parseLSquare())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(posAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (posAttr) result.getOrAddProperties<vector_extract::Properties>().pos = posAttr;
if (parser.parseRSquare())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
if (parser.parseKeyword("from"))
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
srcvecRawType = type;
}
result.addTypes(resTypes);
if (parser.resolveOperands(srcvecOperands, srcvecTypes, srcvecOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void vector_extract::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getSrcvec();
_odsPrinter << "[";
_odsPrinter.printAttributeWithoutType(getPosAttr());
_odsPrinter << "]";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("pos");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "from";
_odsPrinter << ' ';
{
auto type = getSrcvec().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void vector_extract::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_extract)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_extractGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_insert definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_insertGenericAdaptorBase::vector_insertGenericAdaptorBase(vector_insert op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
uint64_t vector_insertGenericAdaptorBase::getPos() {
auto attr = getPosAttr();
return attr.getValue().getZExtValue();
}
} // namespace detail
vector_insertAdaptor::vector_insertAdaptor(vector_insert op) : vector_insertGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_insertAdaptor::verify(::mlir::Location loc) {
auto tblgen_pos = getProperties().pos; (void)tblgen_pos;
if (!tblgen_pos) return emitError(loc, "'llvm.intr.vector.insert' op requires attribute 'pos'");
if (tblgen_pos && !(((::llvm::isa<::mlir::IntegerAttr>(tblgen_pos))) && ((::llvm::cast<::mlir::IntegerAttr>(tblgen_pos).getType().isSignlessInteger(64)))))
return emitError(loc, "'llvm.intr.vector.insert' op attribute 'pos' failed to satisfy constraint: 64-bit signless integer attribute");
return ::mlir::success();
}
::llvm::LogicalResult vector_insert::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.pos;
auto attr = dict.get("pos");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `pos` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_insert::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.pos;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("pos",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_insert::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.pos.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_insert::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "pos")
return prop.pos;
return std::nullopt;
}
void vector_insert::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "pos") {
prop.pos = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.pos)>>(value);
return;
}
}
void vector_insert::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.pos) attrs.append("pos", prop.pos);
}
::llvm::LogicalResult vector_insert::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getPosAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(attr, "pos", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_insert::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readAttribute(prop.pos)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_insert::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeAttribute(prop.pos);
}
uint64_t vector_insert::getPos() {
auto attr = getPosAttr();
return attr.getValue().getZExtValue();
}
void vector_insert::setPos(uint64_t attrValue) {
getProperties().pos = ::mlir::Builder((*this)->getContext()).getIntegerAttr(::mlir::Builder((*this)->getContext()).getIntegerType(64), attrValue);
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
odsState.addOperands(dstvec);
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = pos;
odsState.addTypes(res);
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
odsState.addOperands(dstvec);
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = pos;
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(vector_insert::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
return create(builder, builder.getLoc(), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
odsState.addOperands(dstvec);
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = pos;
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dstvec, ::mlir::Value srcvec, ::mlir::IntegerAttr pos) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
odsState.addOperands(dstvec);
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), pos);
odsState.addTypes(res);
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
odsState.addOperands(dstvec);
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), pos);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(vector_insert::inferReturnTypes(odsBuilder.getContext(),
odsState.location, odsState.operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes)))
odsState.addTypes(inferredReturnTypes);
else
::mlir::detail::reportFatalInferReturnTypesError(odsState);
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
return create(builder, builder.getLoc(), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
odsState.addOperands(dstvec);
odsState.addOperands(srcvec);
odsState.getOrAddProperties<Properties>().pos = odsBuilder.getIntegerAttr(odsBuilder.getIntegerType(64), pos);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value dstvec, ::mlir::Value srcvec, uint64_t pos) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(dstvec)>(dstvec), std::forward<decltype(srcvec)>(srcvec), std::forward<decltype(pos)>(pos));
}
void vector_insert::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_insert::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_insert::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(vector_insert::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_insert::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void vector_insert::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties &>(properties));
odsState.addAttributes(discardableAttributes);
::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
if (::mlir::succeeded(vector_insert::inferReturnTypes(odsBuilder.getContext(),
odsState.location, operands,
odsState.attributes.getDictionary(odsState.getContext()),
odsState.getRawProperties(),
odsState.regions, inferredReturnTypes))) {
assert(inferredReturnTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(inferredReturnTypes);
} else {
::llvm::report_fatal_error("Failed to infer result type(s).");
}
}
vector_insert vector_insert::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_insert>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_insert vector_insert::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_insert::verifyInvariantsImpl() {
auto tblgen_pos = getProperties().pos; (void)tblgen_pos;
if (!tblgen_pos) return emitOpError("requires attribute 'pos'");
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps11(*this, tblgen_pos, "pos")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSResults(0).begin()).getType()) && ((*this->getODSResults(0).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType()))))
return emitOpError("failed to verify that all of {dstvec, res} have same type");
if (!(((getSrcVectorBitWidth() <= 131072)) && ((getDstVectorBitWidth() <= 131072))))
return emitOpError("failed to verify that vectors are not bigger than 2^17 bits.");
if (!((!isScalableVectorType((*this->getODSOperands(1).begin()).getType()) || isScalableVectorType((*this->getODSOperands(0).begin()).getType()))))
return emitOpError("failed to verify that it is not inserting scalable into fixed-length vectors.");
return ::mlir::success();
}
::llvm::LogicalResult vector_insert::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_insert::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) {
inferredReturnTypes.resize(1);
::mlir::Builder odsBuilder(context);
if (operands.size() <= 0)
return ::mlir::failure();
::mlir::Type odsInferredType0 = operands[0].getType();
inferredReturnTypes[0] = odsInferredType0;
return ::mlir::success();
}
::mlir::ParseResult vector_insert::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::mlir::OpAsmParser::UnresolvedOperand srcvecRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> srcvecOperands(&srcvecRawOperand, 1); ::llvm::SMLoc srcvecOperandsLoc;
(void)srcvecOperandsLoc;
::mlir::OpAsmParser::UnresolvedOperand dstvecRawOperand{};
::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> dstvecOperands(&dstvecRawOperand, 1); ::llvm::SMLoc dstvecOperandsLoc;
(void)dstvecOperandsLoc;
::mlir::IntegerAttr posAttr;
::mlir::Type srcvecRawType{};
::llvm::ArrayRef<::mlir::Type> srcvecTypes(&srcvecRawType, 1);
::mlir::Type resRawType{};
::llvm::ArrayRef<::mlir::Type> resTypes(&resRawType, 1);
srcvecOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(srcvecRawOperand))
return ::mlir::failure();
if (parser.parseComma())
return ::mlir::failure();
dstvecOperandsLoc = parser.getCurrentLocation();
if (parser.parseOperand(dstvecRawOperand))
return ::mlir::failure();
if (parser.parseLSquare())
return ::mlir::failure();
if (parser.parseCustomAttributeWithFallback(posAttr, parser.getBuilder().getIntegerType(64))) {
return ::mlir::failure();
}
if (posAttr) result.getOrAddProperties<vector_insert::Properties>().pos = posAttr;
if (parser.parseRSquare())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
srcvecRawType = type;
}
if (parser.parseKeyword("into"))
return ::mlir::failure();
{
::mlir::VectorType type;
if (parser.parseCustomTypeWithFallback(type))
return ::mlir::failure();
resRawType = type;
}
result.addTypes(resTypes);
if (parser.resolveOperands(dstvecOperands, resTypes[0], dstvecOperandsLoc, result.operands))
return ::mlir::failure();
if (parser.resolveOperands(srcvecOperands, srcvecTypes, srcvecOperandsLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void vector_insert::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << ' ';
_odsPrinter << getSrcvec();
_odsPrinter << ",";
_odsPrinter << ' ';
_odsPrinter << getDstvec();
_odsPrinter << "[";
_odsPrinter.printAttributeWithoutType(getPosAttr());
_odsPrinter << "]";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
elidedAttrs.push_back("pos");
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
{
auto type = getSrcvec().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
_odsPrinter << ' ' << "into";
_odsPrinter << ' ';
{
auto type = getRes().getType();
if (auto validType = ::llvm::dyn_cast<::mlir::VectorType>(type))
_odsPrinter.printStrippedAttrOrType(validType);
else
_odsPrinter << type;
}
}
void vector_insert::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_insert)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_insertGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_interleave2 definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_interleave2GenericAdaptorBase::vector_interleave2GenericAdaptorBase(vector_interleave2 op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_interleave2Adaptor::vector_interleave2Adaptor(vector_interleave2 op) : vector_interleave2GenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_interleave2Adaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_interleave2::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_interleave2::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_interleave2::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_interleave2::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_interleave2::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_interleave2::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_interleave2::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_interleave2::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value vec1, ::mlir::Value vec2) {
odsState.addOperands(vec1);
odsState.addOperands(vec2);
odsState.addTypes(res);
}
vector_interleave2 vector_interleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value vec1, ::mlir::Value vec2) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(vec1)>(vec1), std::forward<decltype(vec2)>(vec2));
auto __res__ = ::llvm::dyn_cast<vector_interleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_interleave2 vector_interleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value vec1, ::mlir::Value vec2) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(vec1)>(vec1), std::forward<decltype(vec2)>(vec2));
}
void vector_interleave2::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value vec1, ::mlir::Value vec2) {
odsState.addOperands(vec1);
odsState.addOperands(vec2);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_interleave2 vector_interleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value vec1, ::mlir::Value vec2) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(vec1)>(vec1), std::forward<decltype(vec2)>(vec2));
auto __res__ = ::llvm::dyn_cast<vector_interleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_interleave2 vector_interleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value vec1, ::mlir::Value vec2) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(vec1)>(vec1), std::forward<decltype(vec2)>(vec2));
}
void vector_interleave2::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_interleave2 vector_interleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_interleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_interleave2 vector_interleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_interleave2::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_interleave2 vector_interleave2::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_interleave2>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_interleave2 vector_interleave2::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_interleave2::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps13(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
if (!((((*this->getODSOperands(0).begin()).getType()) == ((*this->getODSOperands(1).begin()).getType()) && ((*this->getODSOperands(1).begin()).getType()) == ((*this->getODSOperands(0).begin()).getType()))))
return emitOpError("failed to verify that all of {vec1, vec2} have same type");
if (!(((getVectorNumElements((*this->getODSResults(0).begin()).getType()) == getVectorNumElements((*this->getODSOperands(0).begin()).getType()) * 2)) && ((::llvm::cast<VectorType>((*this->getODSOperands(0).begin()).getType()).getElementType() == ::llvm::cast<VectorType>((*this->getODSResults(0).begin()).getType()).getElementType()))))
return emitOpError("failed to verify that result has twice as many elements as 'vec1'");
return ::mlir::success();
}
::llvm::LogicalResult vector_interleave2::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_interleave2::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_interleave2::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_interleave2)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_add definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_addGenericAdaptorBase::vector_reduce_addGenericAdaptorBase(vector_reduce_add op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_addAdaptor::vector_reduce_addAdaptor(vector_reduce_add op) : vector_reduce_addGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_addAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_add::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_add::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_add::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_add::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_add::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_add::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_add::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_add::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_add vector_reduce_add::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_add>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_add vector_reduce_add::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_add::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_add vector_reduce_add::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_add>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_add vector_reduce_add::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_add::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_add vector_reduce_add::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_add>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_add vector_reduce_add::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_add::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_add vector_reduce_add::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_add>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_add vector_reduce_add::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_add::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_add::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_add::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_add::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_add)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_and definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_andGenericAdaptorBase::vector_reduce_andGenericAdaptorBase(vector_reduce_and op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_andAdaptor::vector_reduce_andAdaptor(vector_reduce_and op) : vector_reduce_andGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_andAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_and::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_and::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_and::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_and::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_and::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_and::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_and::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_and::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_and vector_reduce_and::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_and>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_and vector_reduce_and::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_and::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_and vector_reduce_and::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_and>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_and vector_reduce_and::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_and::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_and vector_reduce_and::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_and>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_and vector_reduce_and::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_and::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_and vector_reduce_and::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_and>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_and vector_reduce_and::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_and::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_and::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_and::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_and::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_and)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_fadd definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_faddGenericAdaptorBase::vector_reduce_faddGenericAdaptorBase(vector_reduce_fadd op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr vector_reduce_faddGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags vector_reduce_faddGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
vector_reduce_faddAdaptor::vector_reduce_faddAdaptor(vector_reduce_fadd op) : vector_reduce_faddGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_faddAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.vector.reduce.fadd' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fadd::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_fadd::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_fadd::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_reduce_fadd::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void vector_reduce_fadd::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void vector_reduce_fadd::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult vector_reduce_fadd::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fadd::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fadd::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags vector_reduce_fadd::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void vector_reduce_fadd::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void vector_reduce_fadd::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fadd>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fadd::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fadd>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fadd::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fadd>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fadd::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fadd>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fadd::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_reduce_fadd::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fadd>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_fadd::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fadd>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fadd vector_reduce_fadd::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void vector_reduce_fadd::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult vector_reduce_fadd::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps21(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fadd::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_fadd::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.fastmathFlags;
auto fastmathFlagsAttrName = ::mlir::StringAttr::get(ctx, "fastmathFlags");
auto attr = dict.get(fastmathFlagsAttrName);
usedKeys.insert(fastmathFlagsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for fastmathFlags in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_fadd::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_fadd)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_reduce_faddGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_fmax definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_fmaxGenericAdaptorBase::vector_reduce_fmaxGenericAdaptorBase(vector_reduce_fmax op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr vector_reduce_fmaxGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags vector_reduce_fmaxGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
vector_reduce_fmaxAdaptor::vector_reduce_fmaxAdaptor(vector_reduce_fmax op) : vector_reduce_fmaxGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_fmaxAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.vector.reduce.fmax' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmax::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_fmax::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_fmax::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_reduce_fmax::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void vector_reduce_fmax::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void vector_reduce_fmax::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult vector_reduce_fmax::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmax::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fmax::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags vector_reduce_fmax::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void vector_reduce_fmax::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void vector_reduce_fmax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmax::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_reduce_fmax::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_fmax::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmax vector_reduce_fmax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void vector_reduce_fmax::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult vector_reduce_fmax::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmax::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult vector_reduce_fmax::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fmax::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void vector_reduce_fmax::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_fmax)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_reduce_fmaxGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_fmaximum definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_fmaximumGenericAdaptorBase::vector_reduce_fmaximumGenericAdaptorBase(vector_reduce_fmaximum op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr vector_reduce_fmaximumGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags vector_reduce_fmaximumGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
vector_reduce_fmaximumAdaptor::vector_reduce_fmaximumAdaptor(vector_reduce_fmaximum op) : vector_reduce_fmaximumGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_fmaximumAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.vector.reduce.fmaximum' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmaximum::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_fmaximum::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_fmaximum::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_reduce_fmaximum::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void vector_reduce_fmaximum::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void vector_reduce_fmaximum::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult vector_reduce_fmaximum::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmaximum::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fmaximum::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags vector_reduce_fmaximum::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void vector_reduce_fmaximum::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void vector_reduce_fmaximum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmaximum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmaximum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmaximum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmaximum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmaximum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmaximum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmaximum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmaximum::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_reduce_fmaximum::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmaximum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_fmaximum::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmaximum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmaximum vector_reduce_fmaximum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void vector_reduce_fmaximum::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult vector_reduce_fmaximum::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmaximum::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult vector_reduce_fmaximum::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fmaximum::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void vector_reduce_fmaximum::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_fmaximum)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_reduce_fmaximumGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_fmin definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_fminGenericAdaptorBase::vector_reduce_fminGenericAdaptorBase(vector_reduce_fmin op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr vector_reduce_fminGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags vector_reduce_fminGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
vector_reduce_fminAdaptor::vector_reduce_fminAdaptor(vector_reduce_fmin op) : vector_reduce_fminGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_fminAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.vector.reduce.fmin' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmin::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_fmin::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_fmin::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_reduce_fmin::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void vector_reduce_fmin::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void vector_reduce_fmin::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult vector_reduce_fmin::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmin::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fmin::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags vector_reduce_fmin::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void vector_reduce_fmin::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void vector_reduce_fmin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmin::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_reduce_fmin::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_fmin::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmin vector_reduce_fmin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void vector_reduce_fmin::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult vector_reduce_fmin::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmin::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult vector_reduce_fmin::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fmin::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void vector_reduce_fmin::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_fmin)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_reduce_fminGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_fminimum definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_fminimumGenericAdaptorBase::vector_reduce_fminimumGenericAdaptorBase(vector_reduce_fminimum op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr vector_reduce_fminimumGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags vector_reduce_fminimumGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
vector_reduce_fminimumAdaptor::vector_reduce_fminimumAdaptor(vector_reduce_fminimum op) : vector_reduce_fminimumGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_fminimumAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.vector.reduce.fminimum' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fminimum::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_fminimum::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_fminimum::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_reduce_fminimum::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void vector_reduce_fminimum::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void vector_reduce_fminimum::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult vector_reduce_fminimum::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fminimum::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fminimum::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags vector_reduce_fminimum::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void vector_reduce_fminimum::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void vector_reduce_fminimum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fminimum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fminimum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(in);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fminimum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fminimum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fminimum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fminimum::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(in);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fminimum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fminimum::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_reduce_fminimum::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fminimum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_fminimum::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fminimum>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fminimum vector_reduce_fminimum::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void vector_reduce_fminimum::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult vector_reduce_fminimum::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fminimum::verifyInvariants() {
return verifyInvariantsImpl();
}
::mlir::ParseResult vector_reduce_fminimum::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> allOperands;
::llvm::ArrayRef<::mlir::Type> allOperandTypes;
::llvm::ArrayRef<::mlir::Type> allResultTypes;
if (parser.parseLParen())
return ::mlir::failure();
[[maybe_unused]] ::llvm::SMLoc allOperandLoc = parser.getCurrentLocation();
if (parser.parseOperandList(allOperands))
return ::mlir::failure();
if (parser.parseRParen())
return ::mlir::failure();
{
auto loc = parser.getCurrentLocation();(void)loc;
if (parser.parseOptionalAttrDict(result.attributes))
return ::mlir::failure();
if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
})))
return ::mlir::failure();
}
if (parser.parseColon())
return ::mlir::failure();
::mlir::FunctionType allOperand__allResult_functionType;
if (parser.parseType(allOperand__allResult_functionType))
return ::mlir::failure();
allOperandTypes = allOperand__allResult_functionType.getInputs();
allResultTypes = allOperand__allResult_functionType.getResults();
result.addTypes(allResultTypes);
if (parser.resolveOperands(allOperands, allOperandTypes, allOperandLoc, result.operands))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fminimum::print(::mlir::OpAsmPrinter &_odsPrinter) {
_odsPrinter << "(";
_odsPrinter << getOperation()->getOperands();
_odsPrinter << ")";
::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
{
::mlir::Builder odsBuilder(getContext());
::mlir::Attribute attr = getFastmathFlagsAttr();
if(attr && (attr == ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {})))
elidedAttrs.push_back("fastmathFlags");
}
_odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
_odsPrinter << ' ' << ":";
_odsPrinter << ' ';
_odsPrinter.printFunctionalType(getOperation()->getOperandTypes(), getOperation()->getResultTypes());
}
void vector_reduce_fminimum::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_fminimum)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_reduce_fminimumGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_fmul definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_fmulGenericAdaptorBase::vector_reduce_fmulGenericAdaptorBase(vector_reduce_fmul op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
::mlir::LLVM::FastmathFlagsAttr vector_reduce_fmulGenericAdaptorBase::getFastmathFlagsAttr() {
auto attr = ::llvm::dyn_cast_or_null<::mlir::LLVM::FastmathFlagsAttr>(getProperties().fastmathFlags);
return attr;
}
::mlir::LLVM::FastmathFlags vector_reduce_fmulGenericAdaptorBase::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
} // namespace detail
vector_reduce_fmulAdaptor::vector_reduce_fmulAdaptor(vector_reduce_fmul op) : vector_reduce_fmulGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_fmulAdaptor::verify(::mlir::Location loc) {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (tblgen_fastmathFlags && !((::llvm::isa<::mlir::LLVM::FastmathFlagsAttr>(tblgen_fastmathFlags))))
return emitError(loc, "'llvm.intr.vector.reduce.fmul' op attribute 'fastmathFlags' failed to satisfy constraint: LLVM fastmath flags");
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmul::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
{
auto &propStorage = prop.fastmathFlags;
auto attr = dict.get("fastmathFlags");
if (attr) {
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_fmul::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
{
const auto &propStorage = prop.fastmathFlags;
if (propStorage)
attrs.push_back(odsBuilder.getNamedAttr("fastmathFlags",
propStorage));
}
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_fmul::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine(
llvm::hash_value(prop.fastmathFlags.getAsOpaquePointer()));
}
std::optional<mlir::Attribute> vector_reduce_fmul::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
if (name == "fastmathFlags")
return prop.fastmathFlags;
return std::nullopt;
}
void vector_reduce_fmul::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
if (name == "fastmathFlags") {
prop.fastmathFlags = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.fastmathFlags)>>(value);
return;
}
}
void vector_reduce_fmul::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
if (prop.fastmathFlags) attrs.append("fastmathFlags", prop.fastmathFlags);
}
::llvm::LogicalResult vector_reduce_fmul::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
{
::mlir::Attribute attr = attrs.get(getFastmathFlagsAttrName(opName));
if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(attr, "fastmathFlags", emitError)))
return ::mlir::failure();
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmul::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
if (::mlir::failed(reader.readOptionalAttribute(prop.fastmathFlags)))
return ::mlir::failure();
return ::mlir::success();
}
void vector_reduce_fmul::writeProperties(::mlir::DialectBytecodeWriter &writer) {
auto &prop = getProperties(); (void)prop;
writer.writeOptionalAttribute(prop.fastmathFlags);
}
::mlir::LLVM::FastmathFlags vector_reduce_fmul::getFastmathFlags() {
auto attr = getFastmathFlagsAttr();
return attr.getValue();
}
void vector_reduce_fmul::setFastmathFlags(::mlir::LLVM::FastmathFlags attrValue) {
getProperties().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
}
void vector_reduce_fmul::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
odsState.addTypes(res);
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmul::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
if (fastmathFlags) {
odsState.getOrAddProperties<Properties>().fastmathFlags = fastmathFlags;
}
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlagsAttr fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmul::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
odsState.addTypes(res);
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmul::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
odsState.addOperands(start_value);
odsState.addOperands(input);
odsState.getOrAddProperties<Properties>().fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), fastmathFlags);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value start_value, ::mlir::Value input, ::mlir::LLVM::FastmathFlags fastmathFlags) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(start_value)>(start_value), std::forward<decltype(input)>(input), std::forward<decltype(fastmathFlags)>(fastmathFlags));
}
void vector_reduce_fmul::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
if (!attributes.empty()) {
(void)odsState.getOrAddProperties<vector_reduce_fmul::Properties>();
::mlir::PropertyRef properties = odsState.getRawProperties();
std::optional<::mlir::RegisteredOperationName> info =
odsState.name.getRegisteredInfo();
if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
::llvm::report_fatal_error("Property conversion failed.");
}
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_fmul::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 2u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_fmul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_fmul vector_reduce_fmul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
void vector_reduce_fmul::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
::mlir::Builder odsBuilder(opName.getContext());
if (!properties.fastmathFlags)
properties.fastmathFlags = ::mlir::LLVM::FastmathFlagsAttr::get(odsBuilder.getContext(), {});
}
::llvm::LogicalResult vector_reduce_fmul::verifyInvariantsImpl() {
auto tblgen_fastmathFlags = getProperties().fastmathFlags; (void)tblgen_fastmathFlags;
if (::mlir::failed(__mlir_ods_local_attr_constraint_LLVMIntrinsicOps1(*this, tblgen_fastmathFlags, "fastmathFlags")))
return ::mlir::failure();
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps21(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
auto valueGroup1 = getODSOperands(1);
for (auto v : valueGroup1) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps19(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_fmul::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_fmul::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
{
auto &propStorage = prop.fastmathFlags;
auto fastmathFlagsAttrName = ::mlir::StringAttr::get(ctx, "fastmathFlags");
auto attr = dict.get(fastmathFlagsAttrName);
usedKeys.insert(fastmathFlagsAttrName);
if (attr || /*isRequired=*/false) {
if (!attr) {
emitError() << "expected key entry for fastmathFlags in DictionaryAttr to set "
"Properties.";
return ::mlir::failure();
}
auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
if (convertedAttr) {
propStorage = convertedAttr;
} else {
emitError() << "Invalid attribute `fastmathFlags` in property conversion: " << attr;
return ::mlir::failure();
}
}
}
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_fmul::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_fmul)
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::detail::vector_reduce_fmulGenericAdaptorBase::Properties)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_mul definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_mulGenericAdaptorBase::vector_reduce_mulGenericAdaptorBase(vector_reduce_mul op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_mulAdaptor::vector_reduce_mulAdaptor(vector_reduce_mul op) : vector_reduce_mulGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_mulAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_mul::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_mul::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_mul::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_mul::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_mul::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_mul::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_mul::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_mul::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_mul vector_reduce_mul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_mul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_mul vector_reduce_mul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_mul::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_mul vector_reduce_mul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_mul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_mul vector_reduce_mul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_mul::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_mul vector_reduce_mul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_mul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_mul vector_reduce_mul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_mul::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_mul vector_reduce_mul::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_mul>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_mul vector_reduce_mul::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_mul::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_mul::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_mul::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_mul::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_mul)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_or definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_orGenericAdaptorBase::vector_reduce_orGenericAdaptorBase(vector_reduce_or op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_orAdaptor::vector_reduce_orAdaptor(vector_reduce_or op) : vector_reduce_orGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_orAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_or::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_or::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_or::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_or::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_or::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_or::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_or::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_or::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_or vector_reduce_or::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_or>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_or vector_reduce_or::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_or::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_or vector_reduce_or::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_or>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_or vector_reduce_or::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_or::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_or vector_reduce_or::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_or>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_or vector_reduce_or::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_or::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_or vector_reduce_or::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_or>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_or vector_reduce_or::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_or::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_or::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_or::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_or::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_or)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_smax definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_smaxGenericAdaptorBase::vector_reduce_smaxGenericAdaptorBase(vector_reduce_smax op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_smaxAdaptor::vector_reduce_smaxAdaptor(vector_reduce_smax op) : vector_reduce_smaxGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_smaxAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_smax::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_smax::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_smax::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_smax::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_smax::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_smax::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_smax::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_smax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_smax vector_reduce_smax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smax vector_reduce_smax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_smax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_smax vector_reduce_smax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smax vector_reduce_smax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_smax::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_smax vector_reduce_smax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smax vector_reduce_smax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_smax::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_smax vector_reduce_smax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smax vector_reduce_smax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_smax::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_smax::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_smax::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_smax::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_smax)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_smin definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_sminGenericAdaptorBase::vector_reduce_sminGenericAdaptorBase(vector_reduce_smin op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_sminAdaptor::vector_reduce_sminAdaptor(vector_reduce_smin op) : vector_reduce_sminGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_sminAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_smin::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_smin::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_smin::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_smin::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_smin::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_smin::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_smin::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_smin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_smin vector_reduce_smin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smin vector_reduce_smin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_smin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_smin vector_reduce_smin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smin vector_reduce_smin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_smin::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_smin vector_reduce_smin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smin vector_reduce_smin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_smin::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_smin vector_reduce_smin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_smin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_smin vector_reduce_smin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_smin::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_smin::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_smin::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_smin::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_smin)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_umax definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_umaxGenericAdaptorBase::vector_reduce_umaxGenericAdaptorBase(vector_reduce_umax op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_umaxAdaptor::vector_reduce_umaxAdaptor(vector_reduce_umax op) : vector_reduce_umaxGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_umaxAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_umax::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_umax::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_umax::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_umax::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_umax::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_umax::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_umax::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_umax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_umax vector_reduce_umax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umax vector_reduce_umax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_umax::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_umax vector_reduce_umax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umax vector_reduce_umax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_umax::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_umax vector_reduce_umax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umax vector_reduce_umax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_umax::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_umax vector_reduce_umax::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umax>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umax vector_reduce_umax::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_umax::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_umax::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_umax::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_umax::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_umax)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_umin definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_uminGenericAdaptorBase::vector_reduce_uminGenericAdaptorBase(vector_reduce_umin op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_uminAdaptor::vector_reduce_uminAdaptor(vector_reduce_umin op) : vector_reduce_uminGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_uminAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_umin::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_umin::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_umin::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_umin::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_umin::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_umin::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_umin::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_umin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_umin vector_reduce_umin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umin vector_reduce_umin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_umin::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_umin vector_reduce_umin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umin vector_reduce_umin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_umin::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_umin vector_reduce_umin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umin vector_reduce_umin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_umin::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_umin vector_reduce_umin::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_umin>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_umin vector_reduce_umin::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_umin::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_umin::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_umin::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_umin::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_umin)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vector_reduce_xor definitions
//===----------------------------------------------------------------------===//
namespace detail {
vector_reduce_xorGenericAdaptorBase::vector_reduce_xorGenericAdaptorBase(vector_reduce_xor op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vector_reduce_xorAdaptor::vector_reduce_xorAdaptor(vector_reduce_xor op) : vector_reduce_xorGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vector_reduce_xorAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_xor::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vector_reduce_xor::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vector_reduce_xor::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vector_reduce_xor::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vector_reduce_xor::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vector_reduce_xor::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vector_reduce_xor::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vector_reduce_xor::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res, ::mlir::Value in) {
odsState.addOperands(in);
odsState.addTypes(res);
}
vector_reduce_xor vector_reduce_xor::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_xor>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_xor vector_reduce_xor::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res), std::forward<decltype(in)>(in));
}
void vector_reduce_xor::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
odsState.addOperands(in);
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vector_reduce_xor vector_reduce_xor::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
auto __res__ = ::llvm::dyn_cast<vector_reduce_xor>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_xor vector_reduce_xor::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value in) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(in)>(in));
}
void vector_reduce_xor::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_xor vector_reduce_xor::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_xor>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_xor vector_reduce_xor::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vector_reduce_xor::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 1u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vector_reduce_xor vector_reduce_xor::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vector_reduce_xor>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vector_reduce_xor vector_reduce_xor::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vector_reduce_xor::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSOperands(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps18(*this, v.getType(), "operand", index++)))
return ::mlir::failure();
}
}
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vector_reduce_xor::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vector_reduce_xor::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
void vector_reduce_xor::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vector_reduce_xor)
namespace mlir::LLVM {
//===----------------------------------------------------------------------===//
// ::mlir::LLVM::vscale definitions
//===----------------------------------------------------------------------===//
namespace detail {
vscaleGenericAdaptorBase::vscaleGenericAdaptorBase(vscale op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
} // namespace detail
vscaleAdaptor::vscaleAdaptor(vscale op) : vscaleGenericAdaptor(op->getOperands(), op) {}
::llvm::LogicalResult vscaleAdaptor::verify(::mlir::Location loc) {
return ::mlir::success();
}
::llvm::LogicalResult vscale::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
return ::mlir::success();
}
::mlir::Attribute vscale::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
::mlir::SmallVector<::mlir::NamedAttribute> attrs;
::mlir::Builder odsBuilder{ctx};
if (!attrs.empty())
return odsBuilder.getDictionaryAttr(attrs);
return {};
}
llvm::hash_code vscale::computePropertiesHash(const Properties &prop) {
using llvm::hash_value;
return llvm::hash_combine();
}
std::optional<mlir::Attribute> vscale::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
return std::nullopt;
}
void vscale::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
}
void vscale::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
}
::llvm::LogicalResult vscale::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
return ::mlir::success();
}
void vscale::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type res) {
odsState.addTypes(res);
}
vscale vscale::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type res) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(res)>(res));
auto __res__ = ::llvm::dyn_cast<vscale>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vscale vscale::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type res) {
return create(builder, builder.getLoc(), std::forward<decltype(res)>(res));
}
void vscale::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes) {
assert(resultTypes.size() == 1u && "mismatched number of results");
odsState.addTypes(resultTypes);
}
vscale vscale::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes));
auto __res__ = ::llvm::dyn_cast<vscale>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vscale vscale::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes));
}
void vscale::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.addAttributes(attributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vscale vscale::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
auto __res__ = ::llvm::dyn_cast<vscale>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vscale vscale::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(attributes)>(attributes));
}
void vscale::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
assert(operands.size() == 0u && "mismatched number of parameters");
odsState.addOperands(operands);
odsState.useProperties(const_cast<Properties&>(properties));
odsState.addAttributes(discardableAttributes);
assert(resultTypes.size() == 1u && "mismatched number of return types");
odsState.addTypes(resultTypes);
}
vscale vscale::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
::mlir::OperationState __state__(location, getOperationName());
build(builder, __state__, std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
auto __res__ = ::llvm::dyn_cast<vscale>(builder.create(__state__));
assert(__res__ && "builder didn't return the right type");
return __res__;
}
vscale vscale::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
return create(builder, builder.getLoc(), std::forward<decltype(resultTypes)>(resultTypes), std::forward<decltype(operands)>(operands), std::forward<decltype(properties)>(properties), std::forward<decltype(discardableAttributes)>(discardableAttributes));
}
::llvm::LogicalResult vscale::verifyInvariantsImpl() {
{
unsigned index = 0; (void)index;
auto valueGroup0 = getODSResults(0);
for (auto v : valueGroup0) {
if (::mlir::failed(__mlir_ods_local_type_constraint_LLVMIntrinsicOps2(*this, v.getType(), "result", index++)))
return ::mlir::failure();
}
}
return ::mlir::success();
}
::llvm::LogicalResult vscale::verifyInvariants() {
return verifyInvariantsImpl();
}
::llvm::LogicalResult vscale::setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
if (!dict) {
emitError() << "expected DictionaryAttr to set properties";
return ::mlir::failure();
}
// keep track of used keys in the input dictionary to be able to error out
// if there are some unknown ones.
::mlir::DenseSet<::mlir::StringAttr> usedKeys;
::mlir::MLIRContext *ctx = dict.getContext();
(void)ctx;
for (::mlir::NamedAttribute attr : dict) {
if (!usedKeys.contains(attr.getName()))
return emitError() << "unknown key '" << attr.getName() <<
"' when parsing properties dictionary";
}
return ::mlir::success();
}
} // namespace mlir::LLVM
MLIR_DEFINE_EXPLICIT_TYPE_ID(::mlir::LLVM::vscale)
#endif // GET_OP_CLASSES