28static ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops0(
29 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
30 unsigned valueIndex) {
31 if (!((::llvm::isa<::llzk::array::ArrayType>(type)))) {
32 return op->emitOpError(valueKind) <<
" #" << valueIndex
33 <<
" must be n-dimensional array, but got " << type;
35 return ::mlir::success();
38static ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops1(
39 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
40 unsigned valueIndex) {
42 return op->emitOpError(valueKind) <<
" #" << valueIndex
43 <<
" must be a valid array element type, but got " << type;
45 return ::mlir::success();
48static ::mlir::LogicalResult __mlir_ods_local_type_constraint_Ops2(
49 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
50 unsigned valueIndex) {
52 return op->emitOpError(valueKind) <<
" #" << valueIndex
53 <<
" must be any LLZK type, excluding non-Signal struct and string types, but got " << type;
55 return ::mlir::success();
85 return ::mlir::success();
94 return {std::next(getOperation()->operand_begin(), valueRange.first),
95 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
99 return ::llvm::cast<::mlir::TypedValue<::llzk::array::ArrayType>>(*
getODSOperands(0).begin());
108 return getOperation()->getOpOperand(range.first);
113 return getOperation()->getOpOperand(range.first);
122 return {std::next(getOperation()->result_begin(), valueRange.first),
123 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
126void EmitContainmentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
127 odsState.addOperands(lhs);
128 odsState.addOperands(rhs);
131void EmitContainmentOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
132 odsState.addOperands(lhs);
133 odsState.addOperands(rhs);
134 assert(resultTypes.size() == 0u &&
"mismatched number of results");
135 odsState.addTypes(resultTypes);
138void EmitContainmentOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
139 assert(operands.size() == 2u &&
"mismatched number of parameters");
140 odsState.addOperands(operands);
141 odsState.addAttributes(attributes);
142 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
143 odsState.addTypes(resultTypes);
148 unsigned index = 0; (void)index;
151 for (
auto v : valueGroup0) {
152 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops0(*
this, v.getType(),
"operand", index++)))
153 return ::mlir::failure();
157 for (
auto v : valueGroup1) {
158 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
159 return ::mlir::failure();
163 return emitOpError(
"failed to verify that rhs type matches with lhs element type");
164 return ::mlir::success();
172 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperands[1];
173 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(lhsRawOperands); ::llvm::SMLoc lhsOperandsLoc;
174 (void)lhsOperandsLoc;
175 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperands[1];
176 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(rhsRawOperands); ::llvm::SMLoc rhsOperandsLoc;
177 (void)rhsOperandsLoc;
178 ::mlir::Type lhsRawTypes[1];
179 ::llvm::ArrayRef<::mlir::Type> lhsTypes(lhsRawTypes);
180 ::mlir::Type rhsRawTypes[1];
181 ::llvm::ArrayRef<::mlir::Type> rhsTypes(rhsRawTypes);
183 lhsOperandsLoc = parser.getCurrentLocation();
184 if (parser.parseOperand(lhsRawOperands[0]))
185 return ::mlir::failure();
186 if (parser.parseComma())
187 return ::mlir::failure();
189 rhsOperandsLoc = parser.getCurrentLocation();
190 if (parser.parseOperand(rhsRawOperands[0]))
191 return ::mlir::failure();
192 if (parser.parseColon())
193 return ::mlir::failure();
197 if (parser.parseCustomTypeWithFallback(type))
198 return ::mlir::failure();
199 lhsRawTypes[0] = type;
203 if (odsResult) return ::mlir::failure();
206 auto loc = parser.getCurrentLocation();(void)loc;
207 if (parser.parseOptionalAttrDict(result.attributes))
208 return ::mlir::failure();
210 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
211 return ::mlir::failure();
212 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
213 return ::mlir::failure();
214 return ::mlir::success();
223 _odsPrinter <<
' ' <<
":";
226 auto type =
getLhs().getType();
227 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
228 _odsPrinter.printStrippedAttrOrType(validType);
233 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
234 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
267 return ::mlir::success();
276 return {std::next(getOperation()->operand_begin(), valueRange.first),
277 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
290 return getOperation()->getOpOperand(range.first);
295 return getOperation()->getOpOperand(range.first);
304 return {std::next(getOperation()->result_begin(), valueRange.first),
305 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
308void EmitEqualityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs) {
309 odsState.addOperands(lhs);
310 odsState.addOperands(rhs);
313void EmitEqualityOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs) {
314 odsState.addOperands(lhs);
315 odsState.addOperands(rhs);
316 assert(resultTypes.size() == 0u &&
"mismatched number of results");
317 odsState.addTypes(resultTypes);
320void EmitEqualityOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
321 assert(operands.size() == 2u &&
"mismatched number of parameters");
322 odsState.addOperands(operands);
323 odsState.addAttributes(attributes);
324 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
325 odsState.addTypes(resultTypes);
330 unsigned index = 0; (void)index;
333 for (
auto v : valueGroup0) {
334 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
335 return ::mlir::failure();
339 for (
auto v : valueGroup1) {
340 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
341 return ::mlir::failure();
345 return emitOpError(
"failed to verify that rhs type matches with lhs type");
346 return ::mlir::success();
354 ::mlir::OpAsmParser::UnresolvedOperand lhsRawOperands[1];
355 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> lhsOperands(lhsRawOperands); ::llvm::SMLoc lhsOperandsLoc;
356 (void)lhsOperandsLoc;
357 ::mlir::OpAsmParser::UnresolvedOperand rhsRawOperands[1];
358 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rhsOperands(rhsRawOperands); ::llvm::SMLoc rhsOperandsLoc;
359 (void)rhsOperandsLoc;
360 ::mlir::Type lhsRawTypes[1];
361 ::llvm::ArrayRef<::mlir::Type> lhsTypes(lhsRawTypes);
362 ::mlir::Type rhsRawTypes[1];
363 ::llvm::ArrayRef<::mlir::Type> rhsTypes(rhsRawTypes);
365 lhsOperandsLoc = parser.getCurrentLocation();
366 if (parser.parseOperand(lhsRawOperands[0]))
367 return ::mlir::failure();
368 if (parser.parseComma())
369 return ::mlir::failure();
371 rhsOperandsLoc = parser.getCurrentLocation();
372 if (parser.parseOperand(rhsRawOperands[0]))
373 return ::mlir::failure();
374 if (parser.parseColon())
375 return ::mlir::failure();
379 if (parser.parseCustomTypeWithFallback(type))
380 return ::mlir::failure();
381 lhsRawTypes[0] = type;
385 if (odsResult) return ::mlir::failure();
388 auto loc = parser.getCurrentLocation();(void)loc;
389 if (parser.parseOptionalAttrDict(result.attributes))
390 return ::mlir::failure();
392 if (parser.resolveOperands(lhsOperands, lhsTypes, lhsOperandsLoc, result.operands))
393 return ::mlir::failure();
394 if (parser.resolveOperands(rhsOperands, rhsTypes, rhsOperandsLoc, result.operands))
395 return ::mlir::failure();
396 return ::mlir::success();
405 _odsPrinter <<
' ' <<
":";
408 auto type =
getLhs().getType();
409 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
410 _odsPrinter.printStrippedAttrOrType(validType);
415 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
416 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
EmitContainmentOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
EmitContainmentOpAdaptor(EmitContainmentOp op)
::mlir::LogicalResult verify(::mlir::Location loc)
::mlir::ValueRange getOperands()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
::mlir::OpOperand & getRhsMutable()
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::LogicalResult verifyInvariants()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::LogicalResult verifyInvariantsImpl()
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &rhsType, ::mlir::Type lhsType)
::mlir::OpOperand & getLhsMutable()
::mlir::TypedValue<::llzk::array::ArrayType > getLhs()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::LogicalResult verify(::mlir::Location loc)
EmitEqualityOpAdaptor(EmitEqualityOp op)
EmitEqualityOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::LogicalResult verifyInvariantsImpl()
::mlir::OpOperand & getRhsMutable()
static void printInferredOrParsedType(::mlir::OpAsmPrinter &printer, ::mlir::Operation *op, ::mlir::Type rhsType, ::mlir::Type lhsType)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::mlir::Operation::result_range getODSResults(unsigned index)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::OpOperand & getLhsMutable()
::mlir::ParseResult parseInferredOrParsedType(::mlir::OpAsmParser &parser, ::mlir::Type &rhsType, ::mlir::Type lhsType)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
::mlir::LogicalResult verifyInvariants()
::mlir::RegionRange odsRegions
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr getAttributes()
EmitContainmentOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr odsAttrs
::std::optional<::mlir::OperationName > odsOpName
EmitEqualityOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr odsAttrs
::mlir::RegionRange odsRegions
::mlir::DictionaryAttr getAttributes()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
bool isValidArrayElemType(Type type)
bool isValidEmitEqType(Type type)
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)