32static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
33 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
34 unsigned valueIndex) {
35 if (!((::llvm::isa<::llzk::array::ArrayType>(type)))) {
36 return op->emitOpError(valueKind) <<
" #" << valueIndex
37 <<
" must be n-dimensional array, but got " << type;
39 return ::mlir::success();
42static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
43 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
44 unsigned valueIndex) {
45 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
46 return op->emitOpError(valueKind) <<
" #" << valueIndex
47 <<
" must be index, but got " << type;
49 return ::mlir::success();
52static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
53 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
54 unsigned valueIndex) {
56 return op->emitOpError(valueKind) <<
" #" << valueIndex
57 <<
" must be variadic of a valid array element type, but got " << type;
59 return ::mlir::success();
62static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
63 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
64 unsigned valueIndex) {
65 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
66 return op->emitOpError(valueKind) <<
" #" << valueIndex
67 <<
" must be variadic of index, but got " << type;
69 return ::mlir::success();
72static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops5(
73 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
74 unsigned valueIndex) {
76 return op->emitOpError(valueKind) <<
" #" << valueIndex
77 <<
" must be a valid array element type, but got " << type;
79 return ::mlir::success();
82static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
83 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
84 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
85 return emitError() <<
"attribute '" << attrName
86 <<
"' failed to satisfy constraint: i32 dense array attribute";
87 return ::mlir::success();
89static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
90 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
91 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
92 return op->emitOpError();
109 return ::mlir::success();
112void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type length, ::mlir::Value arr_ref, ::mlir::Value dim) {
113 odsState.addOperands(arr_ref);
114 odsState.addOperands(dim);
115 odsState.addTypes(length);
118void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::Value dim) {
119 odsState.addOperands(arr_ref);
120 odsState.addOperands(dim);
122 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
124 odsState.location, odsState.operands,
125 odsState.attributes.getDictionary(odsState.getContext()),
126 odsState.getRawProperties(),
127 odsState.regions, inferredReturnTypes)))
128 odsState.addTypes(inferredReturnTypes);
130 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
134void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::Value dim) {
135 odsState.addOperands(arr_ref);
136 odsState.addOperands(dim);
137 assert(resultTypes.size() == 1u &&
"mismatched number of results");
138 odsState.addTypes(resultTypes);
141void ArrayLengthOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
142 assert(operands.size() == 2u &&
"mismatched number of parameters");
143 odsState.addOperands(operands);
144 odsState.addAttributes(attributes);
145 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
146 odsState.addTypes(resultTypes);
149void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
150 assert(operands.size() == 2u &&
"mismatched number of parameters");
151 odsState.addOperands(operands);
152 odsState.addAttributes(attributes);
154 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
156 odsState.location, operands,
157 odsState.attributes.getDictionary(odsState.getContext()),
158 odsState.getRawProperties(),
159 odsState.regions, inferredReturnTypes))) {
160 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
161 odsState.addTypes(inferredReturnTypes);
163 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
169 unsigned index = 0; (void)index;
172 for (
auto v : valueGroup0) {
173 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
174 return ::mlir::failure();
178 for (
auto v : valueGroup1) {
179 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
180 return ::mlir::failure();
184 unsigned index = 0; (void)index;
187 for (
auto v : valueGroup0) {
188 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"result", index++)))
189 return ::mlir::failure();
192 return ::mlir::success();
199::llvm::LogicalResult
ArrayLengthOp::inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes) {
200 inferredReturnTypes.resize(1);
201 ::mlir::Builder odsBuilder(context);
202 ::mlir::Type odsInferredType0 = odsBuilder.getIndexType();
203 inferredReturnTypes[0] = odsInferredType0;
204 return ::mlir::success();
208 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
209 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
210 (void)arr_refOperandsLoc;
211 ::mlir::OpAsmParser::UnresolvedOperand dimRawOperand{};
212 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> dimOperands(&dimRawOperand, 1); ::llvm::SMLoc dimOperandsLoc;
213 (void)dimOperandsLoc;
214 ::mlir::Type arr_refRawType{};
215 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
217 arr_refOperandsLoc = parser.getCurrentLocation();
218 if (parser.parseOperand(arr_refRawOperand))
219 return ::mlir::failure();
220 if (parser.parseComma())
221 return ::mlir::failure();
223 dimOperandsLoc = parser.getCurrentLocation();
224 if (parser.parseOperand(dimRawOperand))
225 return ::mlir::failure();
226 if (parser.parseColon())
227 return ::mlir::failure();
231 if (parser.parseCustomTypeWithFallback(type))
232 return ::mlir::failure();
233 arr_refRawType = type;
236 auto loc = parser.getCurrentLocation();(void)loc;
237 if (parser.parseOptionalAttrDict(result.attributes))
238 return ::mlir::failure();
240 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
241 result.addTypes(odsBuildableType0);
242 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
243 return ::mlir::failure();
244 if (parser.resolveOperands(dimOperands, odsBuildableType0, dimOperandsLoc, result.operands))
245 return ::mlir::failure();
246 return ::mlir::success();
255 _odsPrinter <<
' ' <<
":";
259 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
260 _odsPrinter.printStrippedAttrOrType(validType);
264 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
265 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
289 for (
unsigned i = 0; i < index; ++i)
290 start += sizeAttr[i];
291 return {start, sizeAttr[index]};
295 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(
getProperties().numDimsPerMap);
314 if (!tblgen_mapOpGroupSizes)
return emitError(loc,
"'array.new' op ""requires attribute 'mapOpGroupSizes'");
317 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
318 return emitError(loc,
"'array.new' op ""attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
320 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
321 return emitError(loc,
"'array.new' op ""attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
322 return ::mlir::success();
326 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
329 for (
unsigned i = 0; i < index; ++i)
330 start += sizeAttr[i];
331 return {start, sizeAttr[index]};
336 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
342 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
347 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
349 emitError() <<
"expected DictionaryAttr to set properties";
350 return ::mlir::failure();
355 auto attr = dict.get(
"mapOpGroupSizes");
357 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
359 propStorage = convertedAttr;
361 emitError() <<
"Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
362 return ::mlir::failure();
369 auto attr = dict.get(
"numDimsPerMap");
371 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
373 propStorage = convertedAttr;
375 emitError() <<
"Invalid attribute `numDimsPerMap` in property conversion: " << attr;
376 return ::mlir::failure();
382 auto setFromAttr = [] (
auto &propStorage, ::mlir::Attribute propAttr,
383 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {
384 return convertFromAttribute(propStorage, propAttr, emitError);
386 auto attr = dict.get(
"operandSegmentSizes");
if (!attr) attr = dict.get(
"operand_segment_sizes");;
389 return ::mlir::failure();
391 return ::mlir::success();
395 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
396 ::mlir::Builder odsBuilder{ctx};
401 attrs.push_back(odsBuilder.getNamedAttr(
"mapOpGroupSizes",
408 attrs.push_back(odsBuilder.getNamedAttr(
"numDimsPerMap",
414 auto attr = [&]() -> ::mlir::Attribute {
415 return ::mlir::DenseI32ArrayAttr::get(ctx, propStorage);
417 attrs.push_back(odsBuilder.getNamedAttr(
"operandSegmentSizes", attr));
421 return odsBuilder.getDictionaryAttr(attrs);
426 auto hash_operandSegmentSizes = [] (
const auto &propStorage) -> llvm::hash_code {
427 return ::llvm::hash_combine_range(std::begin(propStorage), std::end(propStorage));;
429 return llvm::hash_combine(
436 if (
name ==
"mapOpGroupSizes")
439 if (
name ==
"numDimsPerMap")
441 if (
name ==
"operand_segment_sizes" ||
name ==
"operandSegmentSizes")
return [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.
operandSegmentSizes); }();
446 if (
name ==
"mapOpGroupSizes") {
451 if (
name ==
"numDimsPerMap") {
455 if (
name ==
"operand_segment_sizes" ||
name ==
"operandSegmentSizes") {
456 auto arrAttr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(value);
457 if (!arrAttr)
return;
469 attrs.append(
"operandSegmentSizes", [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.
operandSegmentSizes); }());
475 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"mapOpGroupSizes", emitError)))
476 return ::mlir::failure();
481 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"numDimsPerMap", emitError)))
482 return ::mlir::failure();
484 return ::mlir::success();
488 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
490 return ::mlir::failure();
492 if (::mlir::failed(reader.readOptionalAttribute(prop.
numDimsPerMap)))
493 return ::mlir::failure();
495 if (reader.getBytecodeVersion() < 6) {
497 ::mlir::DenseI32ArrayAttr attr;
498 if (::mlir::failed(reader.readAttribute(attr))) return ::mlir::failure();
499 if (attr.size() >
static_cast<int64_t
>(
sizeof(propStorage) /
sizeof(int32_t))) {
500 reader.emitError(
"size mismatch for operand/result_segment_size");
501 return ::mlir::failure();
503 ::llvm::copy(::llvm::ArrayRef<int32_t>(attr), propStorage.begin());
508 auto readProp = [&]() {
510 if (reader.getBytecodeVersion() >= 6)
511 return reader.readSparseArray(::llvm::MutableArrayRef(propStorage));
513 return ::mlir::success();
515 if (::mlir::failed(readProp()))
516 return ::mlir::failure();
518 return ::mlir::success();
522 auto &prop = getProperties(); (void)prop;
527if (writer.getBytecodeVersion() < 6) {
529 writer.writeAttribute(::mlir::DenseI32ArrayAttr::get(this->getContext(), propStorage));
535 if (writer.getBytecodeVersion() >= 6)
536 writer.writeSparseArray(::llvm::ArrayRef(propStorage));
552 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
556 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
560 build(odsBuilder, odsState, result, mapOperands, odsBuilder.getDenseI32ArrayAttr(numDimsPerMap));
565 ::mlir::Builder odsBuilder(opName.getContext());
567 properties.
numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
571 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
572 if (!tblgen_mapOpGroupSizes)
return emitOpError(
"requires attribute 'mapOpGroupSizes'");
573 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
575 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_numDimsPerMap,
"numDimsPerMap")))
576 return ::mlir::failure();
578 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_mapOpGroupSizes,
"mapOpGroupSizes")))
579 return ::mlir::failure();
581 unsigned index = 0; (void)index;
584 for (
auto v : valueGroup0) {
585 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*
this, v.getType(),
"operand", index++)))
586 return ::mlir::failure();
589 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*
this,
"mapOpGroupSizes",
"mapOperands", valueGroup1.size())))
590 return ::mlir::failure();
592 for (
auto v : valueGroup1) {
593 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
594 return ::mlir::failure();
598 unsigned index = 0; (void)index;
601 for (
auto v : valueGroup0) {
602 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
603 return ::mlir::failure();
607 return emitOpError(
"failed to verify that operand types match result type");
608 return ::mlir::success();
613 return ::mlir::success();
614 return ::mlir::failure();
618 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
619 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
620 ::llvm::SMLoc mapOperandsOperandsLoc;
621 (void)mapOperandsOperandsLoc;
622 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
623 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> elementsOperands;
624 ::llvm::SMLoc elementsOperandsLoc;
625 (void)elementsOperandsLoc;
626 ::mlir::Type resultRawType{};
627 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
628 ::llvm::SmallVector<::mlir::Type, 1> elementsTypes;
629 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
631 mapOperandsOperandsLoc = parser.getCurrentLocation();
632 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
634 if (odsResult) return ::mlir::failure();
635 for (
const auto &subRange : mapOperandsOperandGroups) {
636 mapOperandsOperands.append(subRange.begin(), subRange.end());
637 mapOperandsOperandGroupSizes.push_back(subRange.size());
639 if (numDimsPerMapAttr)
642 if (parser.parseRBrace())
643 return ::mlir::failure();
646 elementsOperandsLoc = parser.getCurrentLocation();
647 if (parser.parseOperandList(elementsOperands))
648 return ::mlir::failure();
650 if (parser.parseColon())
651 return ::mlir::failure();
655 if (parser.parseCustomTypeWithFallback(type))
656 return ::mlir::failure();
657 resultRawType = type;
661 if (odsResult) return ::mlir::failure();
665 if (odsResult) return ::mlir::failure();
667::llvm::copy(::llvm::ArrayRef<int32_t>({
static_cast<int32_t
>(elementsOperands.size()),
static_cast<int32_t
>(mapOperandsOperands.size())}), result.getOrAddProperties<
CreateArrayOp::Properties>().operandSegmentSizes.begin());
668 result.getOrAddProperties<
CreateArrayOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
669 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
670 result.addTypes(resultTypes);
671 if (parser.resolveOperands(elementsOperands, elementsTypes, elementsOperandsLoc, result.operands))
672 return ::mlir::failure();
673 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
674 return ::mlir::failure();
675 return ::mlir::success();
679 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
681 emitError() <<
"expected DictionaryAttr to set properties";
682 return ::mlir::failure();
687 auto attr = dict.get(
"mapOpGroupSizes");
690 emitError() <<
"expected key entry for mapOpGroupSizes in DictionaryAttr to set "
692 return ::mlir::failure();
694 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
696 propStorage = convertedAttr;
698 emitError() <<
"Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
699 return ::mlir::failure();
703 return ::mlir::success();
715 _odsPrinter <<
' ' <<
":";
719 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
720 _odsPrinter.printStrippedAttrOrType(validType);
745 bool isVariadic[] = {
false,
true};
746 int prevVariadicCount = 0;
747 for (
unsigned i = 0; i < index; ++i)
748 if (isVariadic[i]) ++prevVariadicCount;
752 int variadicSize = (odsOperandsSize - 1) / 1;
757 int start = index + (variadicSize - 1) * prevVariadicCount;
758 int size = isVariadic[index] ? variadicSize : 1;
759 return {start, size};
766 return ::mlir::success();
770 bool isVariadic[] = {
false,
true};
771 int prevVariadicCount = 0;
772 for (
unsigned i = 0; i < index; ++i)
773 if (isVariadic[i]) ++prevVariadicCount;
777 int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
782 int start = index + (variadicSize - 1) * prevVariadicCount;
783 int size = isVariadic[index] ? variadicSize : 1;
784 return {start, size};
789 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
793void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
794 odsState.addOperands(arr_ref);
795 odsState.addOperands(indices);
796 odsState.addTypes(result);
799void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
800 odsState.addOperands(arr_ref);
801 odsState.addOperands(indices);
803 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
805 odsState.location, odsState.operands,
806 odsState.attributes.getDictionary(odsState.getContext()),
807 odsState.getRawProperties(),
808 odsState.regions, inferredReturnTypes)))
809 odsState.addTypes(inferredReturnTypes);
811 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
815void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
816 odsState.addOperands(arr_ref);
817 odsState.addOperands(indices);
818 assert(resultTypes.size() == 1u &&
"mismatched number of results");
819 odsState.addTypes(resultTypes);
822void ExtractArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
823 assert(operands.size() >= 1u &&
"mismatched number of parameters");
824 odsState.addOperands(operands);
825 odsState.addAttributes(attributes);
826 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
827 odsState.addTypes(resultTypes);
830void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
831 assert(operands.size() >= 1u &&
"mismatched number of parameters");
832 odsState.addOperands(operands);
833 odsState.addAttributes(attributes);
835 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
837 odsState.location, operands,
838 odsState.attributes.getDictionary(odsState.getContext()),
839 odsState.getRawProperties(),
840 odsState.regions, inferredReturnTypes))) {
841 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
842 odsState.addTypes(inferredReturnTypes);
844 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
850 unsigned index = 0; (void)index;
853 for (
auto v : valueGroup0) {
854 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
855 return ::mlir::failure();
859 for (
auto v : valueGroup1) {
860 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
861 return ::mlir::failure();
865 unsigned index = 0; (void)index;
868 for (
auto v : valueGroup0) {
869 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
870 return ::mlir::failure();
873 return ::mlir::success();
881 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
882 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
883 (void)arr_refOperandsLoc;
884 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
885 ::llvm::SMLoc indicesOperandsLoc;
886 (void)indicesOperandsLoc;
887 ::mlir::Type arr_refRawType{};
888 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
890 arr_refOperandsLoc = parser.getCurrentLocation();
891 if (parser.parseOperand(arr_refRawOperand))
892 return ::mlir::failure();
893 if (parser.parseLSquare())
894 return ::mlir::failure();
896 indicesOperandsLoc = parser.getCurrentLocation();
897 if (parser.parseOperandList(indicesOperands))
898 return ::mlir::failure();
899 if (parser.parseRSquare())
900 return ::mlir::failure();
901 if (parser.parseColon())
902 return ::mlir::failure();
906 if (parser.parseCustomTypeWithFallback(type))
907 return ::mlir::failure();
908 arr_refRawType = type;
911 auto loc = parser.getCurrentLocation();(void)loc;
912 if (parser.parseOptionalAttrDict(result.attributes))
913 return ::mlir::failure();
915 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
916 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
917 return ::mlir::failure();
918 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
919 return ::mlir::failure();
921 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
923 result.location, result.operands,
924 result.attributes.getDictionary(parser.getContext()),
925 result.getRawProperties(),
926 result.regions, inferredReturnTypes)))
927 return ::mlir::failure();
928 result.addTypes(inferredReturnTypes);
929 return ::mlir::success();
938 _odsPrinter <<
' ' <<
":";
942 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
943 _odsPrinter.printStrippedAttrOrType(validType);
947 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
948 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
951 ::llvm::LogicalResult
953 std::optional<::mlir::Location> location,
954 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
955 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
956 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
959 location, adaptor, inferredReturnTypes);
980 bool isVariadic[] = {
false,
true,
false};
981 int prevVariadicCount = 0;
982 for (
unsigned i = 0; i < index; ++i)
983 if (isVariadic[i]) ++prevVariadicCount;
987 int variadicSize = (odsOperandsSize - 2) / 1;
992 int start = index + (variadicSize - 1) * prevVariadicCount;
993 int size = isVariadic[index] ? variadicSize : 1;
994 return {start, size};
1001 return ::mlir::success();
1005 bool isVariadic[] = {
false,
true,
false};
1006 int prevVariadicCount = 0;
1007 for (
unsigned i = 0; i < index; ++i)
1008 if (isVariadic[i]) ++prevVariadicCount;
1012 int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
1017 int start = index + (variadicSize - 1) * prevVariadicCount;
1018 int size = isVariadic[index] ? variadicSize : 1;
1019 return {start, size};
1024 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1025 return mutableRange;
1028void InsertArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
1029 odsState.addOperands(arr_ref);
1030 odsState.addOperands(indices);
1031 odsState.addOperands(rvalue);
1034void InsertArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
1035 odsState.addOperands(arr_ref);
1036 odsState.addOperands(indices);
1037 odsState.addOperands(rvalue);
1038 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1039 odsState.addTypes(resultTypes);
1042void InsertArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1043 assert(operands.size() >= 2u &&
"mismatched number of parameters");
1044 odsState.addOperands(operands);
1045 odsState.addAttributes(attributes);
1046 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1047 odsState.addTypes(resultTypes);
1052 unsigned index = 0; (void)index;
1055 for (
auto v : valueGroup0) {
1056 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1057 return ::mlir::failure();
1061 for (
auto v : valueGroup1) {
1062 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
1063 return ::mlir::failure();
1067 for (
auto v : valueGroup2) {
1068 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1069 return ::mlir::failure();
1072 return ::mlir::success();
1077 return ::mlir::success();
1078 return ::mlir::failure();
1082 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
1083 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
1084 (void)arr_refOperandsLoc;
1085 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
1086 ::llvm::SMLoc indicesOperandsLoc;
1087 (void)indicesOperandsLoc;
1088 ::mlir::OpAsmParser::UnresolvedOperand rvalueRawOperand{};
1089 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rvalueOperands(&rvalueRawOperand, 1); ::llvm::SMLoc rvalueOperandsLoc;
1090 (void)rvalueOperandsLoc;
1091 ::mlir::Type arr_refRawType{};
1092 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
1093 ::mlir::Type rvalueRawType{};
1094 ::llvm::ArrayRef<::mlir::Type> rvalueTypes(&rvalueRawType, 1);
1096 arr_refOperandsLoc = parser.getCurrentLocation();
1097 if (parser.parseOperand(arr_refRawOperand))
1098 return ::mlir::failure();
1099 if (parser.parseLSquare())
1100 return ::mlir::failure();
1102 indicesOperandsLoc = parser.getCurrentLocation();
1103 if (parser.parseOperandList(indicesOperands))
1104 return ::mlir::failure();
1105 if (parser.parseRSquare())
1106 return ::mlir::failure();
1107 if (parser.parseEqual())
1108 return ::mlir::failure();
1110 rvalueOperandsLoc = parser.getCurrentLocation();
1111 if (parser.parseOperand(rvalueRawOperand))
1112 return ::mlir::failure();
1113 if (parser.parseColon())
1114 return ::mlir::failure();
1118 if (parser.parseCustomTypeWithFallback(type))
1119 return ::mlir::failure();
1120 arr_refRawType = type;
1122 if (parser.parseComma())
1123 return ::mlir::failure();
1127 if (parser.parseCustomTypeWithFallback(type))
1128 return ::mlir::failure();
1129 rvalueRawType = type;
1132 auto loc = parser.getCurrentLocation();(void)loc;
1133 if (parser.parseOptionalAttrDict(result.attributes))
1134 return ::mlir::failure();
1136 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1137 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
1138 return ::mlir::failure();
1139 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
1140 return ::mlir::failure();
1141 if (parser.resolveOperands(rvalueOperands, rvalueTypes, rvalueOperandsLoc, result.operands))
1142 return ::mlir::failure();
1143 return ::mlir::success();
1152 _odsPrinter <<
' ' <<
"=";
1155 _odsPrinter <<
' ' <<
":";
1159 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
1160 _odsPrinter.printStrippedAttrOrType(validType);
1162 _odsPrinter << type;
1168 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
1169 _odsPrinter.printStrippedAttrOrType(validType);
1171 _odsPrinter << type;
1173 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1174 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1194 bool isVariadic[] = {
false,
true};
1195 int prevVariadicCount = 0;
1196 for (
unsigned i = 0; i < index; ++i)
1197 if (isVariadic[i]) ++prevVariadicCount;
1201 int variadicSize = (odsOperandsSize - 1) / 1;
1206 int start = index + (variadicSize - 1) * prevVariadicCount;
1207 int size = isVariadic[index] ? variadicSize : 1;
1208 return {start, size};
1215 return ::mlir::success();
1219 bool isVariadic[] = {
false,
true};
1220 int prevVariadicCount = 0;
1221 for (
unsigned i = 0; i < index; ++i)
1222 if (isVariadic[i]) ++prevVariadicCount;
1226 int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
1231 int start = index + (variadicSize - 1) * prevVariadicCount;
1232 int size = isVariadic[index] ? variadicSize : 1;
1233 return {start, size};
1238 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1239 return mutableRange;
1242void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1243 odsState.addOperands(arr_ref);
1244 odsState.addOperands(indices);
1245 odsState.addTypes(result);
1248void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1249 odsState.addOperands(arr_ref);
1250 odsState.addOperands(indices);
1252 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1254 odsState.location, odsState.operands,
1255 odsState.attributes.getDictionary(odsState.getContext()),
1256 odsState.getRawProperties(),
1257 odsState.regions, inferredReturnTypes)))
1258 odsState.addTypes(inferredReturnTypes);
1260 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1264void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1265 odsState.addOperands(arr_ref);
1266 odsState.addOperands(indices);
1267 assert(resultTypes.size() == 1u &&
"mismatched number of results");
1268 odsState.addTypes(resultTypes);
1271void ReadArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1272 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1273 odsState.addOperands(operands);
1274 odsState.addAttributes(attributes);
1275 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
1276 odsState.addTypes(resultTypes);
1279void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1280 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1281 odsState.addOperands(operands);
1282 odsState.addAttributes(attributes);
1284 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1286 odsState.location, operands,
1287 odsState.attributes.getDictionary(odsState.getContext()),
1288 odsState.getRawProperties(),
1289 odsState.regions, inferredReturnTypes))) {
1290 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
1291 odsState.addTypes(inferredReturnTypes);
1293 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1299 unsigned index = 0; (void)index;
1302 for (
auto v : valueGroup0) {
1303 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1304 return ::mlir::failure();
1308 for (
auto v : valueGroup1) {
1309 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
1310 return ::mlir::failure();
1314 unsigned index = 0; (void)index;
1317 for (
auto v : valueGroup0) {
1318 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops5(*
this, v.getType(),
"result", index++)))
1319 return ::mlir::failure();
1323 return emitOpError(
"failed to verify that result type matches with arr_ref element type");
1324 return ::mlir::success();
1329 return ::mlir::success();
1330 return ::mlir::failure();
1334 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
1335 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
1336 (void)arr_refOperandsLoc;
1337 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
1338 ::llvm::SMLoc indicesOperandsLoc;
1339 (void)indicesOperandsLoc;
1340 ::mlir::Type arr_refRawType{};
1341 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
1342 ::mlir::Type resultRawType{};
1343 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
1345 arr_refOperandsLoc = parser.getCurrentLocation();
1346 if (parser.parseOperand(arr_refRawOperand))
1347 return ::mlir::failure();
1348 if (parser.parseLSquare())
1349 return ::mlir::failure();
1351 indicesOperandsLoc = parser.getCurrentLocation();
1352 if (parser.parseOperandList(indicesOperands))
1353 return ::mlir::failure();
1354 if (parser.parseRSquare())
1355 return ::mlir::failure();
1356 if (parser.parseColon())
1357 return ::mlir::failure();
1361 if (parser.parseCustomTypeWithFallback(type))
1362 return ::mlir::failure();
1363 arr_refRawType = type;
1365 if (parser.parseComma())
1366 return ::mlir::failure();
1370 if (parser.parseCustomTypeWithFallback(type))
1371 return ::mlir::failure();
1372 resultRawType = type;
1375 auto loc = parser.getCurrentLocation();(void)loc;
1376 if (parser.parseOptionalAttrDict(result.attributes))
1377 return ::mlir::failure();
1379 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1380 result.addTypes(resultTypes);
1381 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
1382 return ::mlir::failure();
1383 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
1384 return ::mlir::failure();
1385 return ::mlir::success();
1394 _odsPrinter <<
' ' <<
":";
1398 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
1399 _odsPrinter.printStrippedAttrOrType(validType);
1401 _odsPrinter << type;
1407 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1408 _odsPrinter.printStrippedAttrOrType(validType);
1410 _odsPrinter << type;
1412 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1413 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1416 ::llvm::LogicalResult
1418 std::optional<::mlir::Location> location,
1419 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1420 ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions,
1421 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1424 location, adaptor, inferredReturnTypes);
1430 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
1431 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
1432 const ::mlir::DataLayout &dataLayout) {
1433 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
1434 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
1439 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
1440 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
1441 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
1442 .rewire(slot, subslots, builder, dataLayout);
1457 ::mlir::Value, const ::mlir::DataLayout &) {
1458 llvm_unreachable(
"getStored() should not be called on ReadArrayOp");
1478 bool isVariadic[] = {
false,
true,
false};
1479 int prevVariadicCount = 0;
1480 for (
unsigned i = 0; i < index; ++i)
1481 if (isVariadic[i]) ++prevVariadicCount;
1485 int variadicSize = (odsOperandsSize - 2) / 1;
1490 int start = index + (variadicSize - 1) * prevVariadicCount;
1491 int size = isVariadic[index] ? variadicSize : 1;
1492 return {start, size};
1499 return ::mlir::success();
1503 bool isVariadic[] = {
false,
true,
false};
1504 int prevVariadicCount = 0;
1505 for (
unsigned i = 0; i < index; ++i)
1506 if (isVariadic[i]) ++prevVariadicCount;
1510 int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
1515 int start = index + (variadicSize - 1) * prevVariadicCount;
1516 int size = isVariadic[index] ? variadicSize : 1;
1517 return {start, size};
1522 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1523 return mutableRange;
1526void WriteArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
1527 odsState.addOperands(arr_ref);
1528 odsState.addOperands(indices);
1529 odsState.addOperands(rvalue);
1532void WriteArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
1533 odsState.addOperands(arr_ref);
1534 odsState.addOperands(indices);
1535 odsState.addOperands(rvalue);
1536 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1537 odsState.addTypes(resultTypes);
1540void WriteArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1541 assert(operands.size() >= 2u &&
"mismatched number of parameters");
1542 odsState.addOperands(operands);
1543 odsState.addAttributes(attributes);
1544 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1545 odsState.addTypes(resultTypes);
1550 unsigned index = 0; (void)index;
1553 for (
auto v : valueGroup0) {
1554 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1555 return ::mlir::failure();
1559 for (
auto v : valueGroup1) {
1560 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
1561 return ::mlir::failure();
1565 for (
auto v : valueGroup2) {
1566 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops5(*
this, v.getType(),
"operand", index++)))
1567 return ::mlir::failure();
1571 return emitOpError(
"failed to verify that rvalue type matches with arr_ref element type");
1572 return ::mlir::success();
1577 return ::mlir::success();
1578 return ::mlir::failure();
1582 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
1583 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
1584 (void)arr_refOperandsLoc;
1585 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
1586 ::llvm::SMLoc indicesOperandsLoc;
1587 (void)indicesOperandsLoc;
1588 ::mlir::OpAsmParser::UnresolvedOperand rvalueRawOperand{};
1589 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rvalueOperands(&rvalueRawOperand, 1); ::llvm::SMLoc rvalueOperandsLoc;
1590 (void)rvalueOperandsLoc;
1591 ::mlir::Type arr_refRawType{};
1592 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
1593 ::mlir::Type rvalueRawType{};
1594 ::llvm::ArrayRef<::mlir::Type> rvalueTypes(&rvalueRawType, 1);
1596 arr_refOperandsLoc = parser.getCurrentLocation();
1597 if (parser.parseOperand(arr_refRawOperand))
1598 return ::mlir::failure();
1599 if (parser.parseLSquare())
1600 return ::mlir::failure();
1602 indicesOperandsLoc = parser.getCurrentLocation();
1603 if (parser.parseOperandList(indicesOperands))
1604 return ::mlir::failure();
1605 if (parser.parseRSquare())
1606 return ::mlir::failure();
1607 if (parser.parseEqual())
1608 return ::mlir::failure();
1610 rvalueOperandsLoc = parser.getCurrentLocation();
1611 if (parser.parseOperand(rvalueRawOperand))
1612 return ::mlir::failure();
1613 if (parser.parseColon())
1614 return ::mlir::failure();
1618 if (parser.parseCustomTypeWithFallback(type))
1619 return ::mlir::failure();
1620 arr_refRawType = type;
1622 if (parser.parseComma())
1623 return ::mlir::failure();
1627 if (parser.parseCustomTypeWithFallback(type))
1628 return ::mlir::failure();
1629 rvalueRawType = type;
1632 auto loc = parser.getCurrentLocation();(void)loc;
1633 if (parser.parseOptionalAttrDict(result.attributes))
1634 return ::mlir::failure();
1636 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1637 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
1638 return ::mlir::failure();
1639 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
1640 return ::mlir::failure();
1641 if (parser.resolveOperands(rvalueOperands, rvalueTypes, rvalueOperandsLoc, result.operands))
1642 return ::mlir::failure();
1643 return ::mlir::success();
1652 _odsPrinter <<
' ' <<
"=";
1655 _odsPrinter <<
' ' <<
":";
1659 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
1660 _odsPrinter.printStrippedAttrOrType(validType);
1662 _odsPrinter << type;
1668 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1669 _odsPrinter.printStrippedAttrOrType(validType);
1671 _odsPrinter << type;
1673 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1674 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1679 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
1680 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
1681 const ::mlir::DataLayout &dataLayout) {
1682 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
1683 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
1688 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
1689 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
1690 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
1691 .rewire(slot, subslots, builder, dataLayout);
1706 ::mlir::Value, const ::mlir::DataLayout &) {
::llvm::LogicalResult verify(::mlir::Location loc)
ArrayLengthOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
ArrayLengthOpAdaptor(ArrayLengthOp op)
::mlir::ValueRange getOperands()
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
::mlir::Operation::result_range getODSResults(unsigned index)
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::Operation::operand_range getODSOperands(unsigned index)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type length, ::mlir::Value arr_ref, ::mlir::Value dim)
::llvm::LogicalResult verifyInvariants()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::TypedValue<::mlir::IndexType > getDim()
CreateArrayOpAdaptor(CreateArrayOp op)
::llvm::LogicalResult verify(::mlir::Location loc)
CreateArrayOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
static void printInferredArrayType(::mlir::OpAsmPrinter &printer, CreateArrayOp, ::mlir::TypeRange, ::mlir::OperandRange, ::mlir::Type)
void writeProperties(::mlir::DialectBytecodeWriter &writer)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
void print(::mlir::OpAsmPrinter &_odsPrinter)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::array::ArrayType result, ::mlir::ValueRange elements={})
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
::mlir::TypedValue<::llzk::array::ArrayType > getResult()
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::ParseResult parseInferredArrayType(::mlir::OpAsmParser &parser, ::llvm::SmallVector<::mlir::Type, 1 > &elementsTypes, ::mlir::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand > elements, ::mlir::Type resultType)
::mlir::MutableOperandRangeRange getMapOperandsMutable()
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::StringAttr getNumDimsPerMapAttrName()
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::Operation::result_range getODSResults(unsigned index)
static llvm::hash_code computePropertiesHash(const Properties &prop)
::llvm::LogicalResult verify()
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::mlir::OperandRangeRange getMapOperands()
::llvm::LogicalResult verifyInvariants()
FoldAdaptor::Properties Properties
::mlir::StringAttr getMapOpGroupSizesAttrName()
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
::mlir::MutableOperandRange getElementsMutable()
::mlir::Operation::operand_range getElements()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
::llvm::LogicalResult verify(::mlir::Location loc)
InsertArrayOpAdaptor(InsertArrayOp op)
InsertArrayOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::mlir::ValueRange getOperands()
::mlir::Operation::operand_range getIndices()
::llvm::LogicalResult verifyInvariantsImpl()
bool isRead()
Return true if the op is a read, false if it's a write.
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verify()
::mlir::TypedValue<::llzk::array::ArrayType > getRvalue()
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue)
::mlir::MutableOperandRange getIndicesMutable()
ReadArrayOpAdaptor(ReadArrayOp op)
ReadArrayOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
::llvm::LogicalResult verify(::mlir::Location loc)
::mlir::ValueRange getOperands()
::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout)
Required by PromotableAllocationOpInterface / mem2reg pass.
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
::mlir::TypedValue<::mlir::Type > getResult()
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
::mlir::Operation::operand_range getIndices()
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
bool isRead()
Return true if the op is a read, false if it's a write.
::llvm::LogicalResult verify()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value arr_ref, ::mlir::ValueRange indices)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::Operation::result_range getODSResults(unsigned index)
::mlir::Operation::operand_range getODSOperands(unsigned index)
bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot > &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
ReadArrayOpAdaptor Adaptor
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::llvm::LogicalResult verifyInvariants()
::mlir::MutableOperandRange getIndicesMutable()
::llvm::LogicalResult verify(::mlir::Location loc)
WriteArrayOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
WriteArrayOpAdaptor(WriteArrayOp op)
::mlir::ValueRange getOperands()
::mlir::DeletionKind rewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot > &subslots, ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
bool isRead()
Return true if the op is a read, false if it's a write.
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
::llvm::LogicalResult verifyInvariants()
::llvm::LogicalResult verify()
::mlir::Operation::operand_range getIndices()
::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout)
Required by PromotableAllocationOpInterface / mem2reg pass.
void print(::mlir::OpAsmPrinter &_odsPrinter)
bool canRewire(const ::mlir::DestructurableMemorySlot &slot, ::llvm::SmallPtrSetImpl<::mlir::Attribute > &usedIndices, ::mlir::SmallVectorImpl<::mlir::MemorySlot > &mustBeSafelyUsed, const ::mlir::DataLayout &dataLayout)
Required by DestructurableAllocationOpInterface / SROA pass.
::llvm::LogicalResult verifyInvariantsImpl()
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue)
::mlir::MutableOperandRange getIndicesMutable()
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::TypedValue<::mlir::Type > getRvalue()
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
::mlir::DictionaryAttr odsAttrs
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
const Properties & getProperties()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
::mlir::RegionRange odsRegions
CreateArrayOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
::std::optional<::mlir::OperationName > odsOpName
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
bool isValidArrayElemType(Type type)
mlir::ParseResult parseAttrDictWithWarnings(mlir::OpAsmParser &parser, mlir::NamedAttrList &extraAttrs, mlir::OperationState &state)
void printMultiDimAndSymbolList(mlir::OpAsmPrinter &printer, mlir::Operation *op, mlir::OperandRangeRange multiMapOperands, mlir::DenseI32ArrayAttr numDimsPerMap)
void printAttrDictWithWarnings(mlir::OpAsmPrinter &printer, ConcreteOp op, mlir::DictionaryAttr extraAttrs, typename mlir::PropertiesSelector< ConcreteOp >::type state)
bool typesUnify(Type lhs, Type rhs, ArrayRef< StringRef > rhsReversePrefix, UnificationMap *unifications)
mlir::ParseResult parseMultiDimAndSymbolList(mlir::OpAsmParser &parser, mlir::SmallVector< mlir::SmallVector< mlir::OpAsmParser::UnresolvedOperand > > &multiMapOperands, mlir::DenseI32ArrayAttr &numDimsPerMap)
mapOpGroupSizesTy mapOpGroupSizes
numDimsPerMapTy numDimsPerMap
operandSegmentSizesTy operandSegmentSizes