30static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
31 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
32 unsigned valueIndex) {
33 if (!((::llvm::isa<::llzk::array::ArrayType>(type)))) {
34 return op->emitOpError(valueKind) <<
" #" << valueIndex
35 <<
" must be n-dimensional array, but got " << type;
37 return ::mlir::success();
40static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
41 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
42 unsigned valueIndex) {
43 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
44 return op->emitOpError(valueKind) <<
" #" << valueIndex
45 <<
" must be index, but got " << type;
47 return ::mlir::success();
50static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
51 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
52 unsigned valueIndex) {
54 return op->emitOpError(valueKind) <<
" #" << valueIndex
55 <<
" must be variadic of a valid array element type, but got " << type;
57 return ::mlir::success();
60static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
61 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
62 unsigned valueIndex) {
63 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
64 return op->emitOpError(valueKind) <<
" #" << valueIndex
65 <<
" must be variadic of index, but got " << type;
67 return ::mlir::success();
70static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops5(
71 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
72 unsigned valueIndex) {
74 return op->emitOpError(valueKind) <<
" #" << valueIndex
75 <<
" must be a valid array element type, but got " << type;
77 return ::mlir::success();
80static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
81 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
82 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
83 return emitError() <<
"attribute '" << attrName
84 <<
"' failed to satisfy constraint: i32 dense array attribute";
85 return ::mlir::success();
87static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
88 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
89 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
90 return op->emitOpError();
109 return ::mlir::success();
113 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
115 emitError() <<
"expected DictionaryAttr to set properties";
116 return ::mlir::failure();
118 return ::mlir::success();
122 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
123 ::mlir::Builder odsBuilder{ctx};
126 return odsBuilder.getDictionaryAttr(attrs);
131 using llvm::hash_value;
132 return llvm::hash_combine();
146 return ::mlir::success();
149void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type length, ::mlir::Value arr_ref, ::mlir::Value dim) {
150 odsState.addOperands(arr_ref);
151 odsState.addOperands(dim);
152 odsState.addTypes(length);
157 build(builder, __state__, std::forward<
decltype(length)>(length), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(dim)>(dim));
158 auto __res__ = ::llvm::dyn_cast<ArrayLengthOp>(builder.create(__state__));
159 assert(__res__ &&
"builder didn't return the right type");
164 return create(builder, builder.getLoc(), std::forward<
decltype(length)>(length), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(dim)>(dim));
167void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::Value dim) {
168 odsState.addOperands(arr_ref);
169 odsState.addOperands(dim);
171 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
173 odsState.location, odsState.operands,
174 odsState.attributes.getDictionary(odsState.getContext()),
175 odsState.getRawProperties(),
176 odsState.regions, inferredReturnTypes)))
177 odsState.addTypes(inferredReturnTypes);
179 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
185 build(builder, __state__, std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(dim)>(dim));
186 auto __res__ = ::llvm::dyn_cast<ArrayLengthOp>(builder.create(__state__));
187 assert(__res__ &&
"builder didn't return the right type");
192 return create(builder, builder.getLoc(), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(dim)>(dim));
195void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::Value dim) {
196 odsState.addOperands(arr_ref);
197 odsState.addOperands(dim);
198 assert(resultTypes.size() == 1u &&
"mismatched number of results");
199 odsState.addTypes(resultTypes);
204 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(dim)>(dim));
205 auto __res__ = ::llvm::dyn_cast<ArrayLengthOp>(builder.create(__state__));
206 assert(__res__ &&
"builder didn't return the right type");
211 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(dim)>(dim));
214void ArrayLengthOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
215 assert(operands.size() == 2u &&
"mismatched number of parameters");
216 odsState.addOperands(operands);
217 odsState.addAttributes(attributes);
218 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
219 odsState.addTypes(resultTypes);
222ArrayLengthOp ArrayLengthOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
224 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
225 auto __res__ = ::llvm::dyn_cast<ArrayLengthOp>(builder.create(__state__));
226 assert(__res__ &&
"builder didn't return the right type");
230ArrayLengthOp ArrayLengthOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
231 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
234void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
235 assert(operands.size() == 2u &&
"mismatched number of parameters");
236 odsState.addOperands(operands);
237 odsState.addAttributes(attributes);
239 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
241 odsState.location, operands,
242 odsState.attributes.getDictionary(odsState.getContext()),
243 odsState.getRawProperties(),
244 odsState.regions, inferredReturnTypes))) {
245 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
246 odsState.addTypes(inferredReturnTypes);
248 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
254 build(builder, __state__, std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
255 auto __res__ = ::llvm::dyn_cast<ArrayLengthOp>(builder.create(__state__));
256 assert(__res__ &&
"builder didn't return the right type");
261 return create(builder, builder.getLoc(), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
264void ArrayLengthOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
265 assert(operands.size() == 2u &&
"mismatched number of parameters");
266 odsState.addOperands(operands);
267 odsState.useProperties(
const_cast<Properties&
>(properties));
268 odsState.addAttributes(discardableAttributes);
269 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
270 odsState.addTypes(resultTypes);
273ArrayLengthOp ArrayLengthOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
275 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
276 auto __res__ = ::llvm::dyn_cast<ArrayLengthOp>(builder.create(__state__));
277 assert(__res__ &&
"builder didn't return the right type");
282 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));
285void ArrayLengthOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
286 assert(operands.size() == 2u &&
"mismatched number of parameters");
287 odsState.addOperands(operands);
288 odsState.useProperties(
const_cast<Properties &
>(properties));
289 odsState.addAttributes(discardableAttributes);
291 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
293 odsState.location, operands,
294 odsState.attributes.getDictionary(odsState.getContext()),
295 odsState.getRawProperties(),
296 odsState.regions, inferredReturnTypes))) {
297 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
298 odsState.addTypes(inferredReturnTypes);
300 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
306 build(builder, __state__, std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
307 auto __res__ = ::llvm::dyn_cast<ArrayLengthOp>(builder.create(__state__));
308 assert(__res__ &&
"builder didn't return the right type");
313 return create(builder, builder.getLoc(), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
318 unsigned index = 0; (void)index;
321 for (
auto v : valueGroup0) {
322 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
323 return ::mlir::failure();
327 for (
auto v : valueGroup1) {
328 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"operand", index++)))
329 return ::mlir::failure();
333 unsigned index = 0; (void)index;
336 for (
auto v : valueGroup0) {
337 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*
this, v.getType(),
"result", index++)))
338 return ::mlir::failure();
341 return ::mlir::success();
348::llvm::LogicalResult
ArrayLengthOp::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) {
349 inferredReturnTypes.resize(1);
350 ::mlir::Builder odsBuilder(context);
351 ::mlir::Type odsInferredType0 = odsBuilder.getIndexType();
352 inferredReturnTypes[0] = odsInferredType0;
353 return ::mlir::success();
357 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
358 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
359 (void)arr_refOperandsLoc;
360 ::mlir::OpAsmParser::UnresolvedOperand dimRawOperand{};
361 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> dimOperands(&dimRawOperand, 1); ::llvm::SMLoc dimOperandsLoc;
362 (void)dimOperandsLoc;
363 ::mlir::Type arr_refRawType{};
364 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
366 arr_refOperandsLoc = parser.getCurrentLocation();
367 if (parser.parseOperand(arr_refRawOperand))
368 return ::mlir::failure();
369 if (parser.parseComma())
370 return ::mlir::failure();
372 dimOperandsLoc = parser.getCurrentLocation();
373 if (parser.parseOperand(dimRawOperand))
374 return ::mlir::failure();
375 if (parser.parseColon())
376 return ::mlir::failure();
380 if (parser.parseCustomTypeWithFallback(type))
381 return ::mlir::failure();
382 arr_refRawType = type;
385 auto loc = parser.getCurrentLocation();(void)loc;
386 if (parser.parseOptionalAttrDict(result.attributes))
387 return ::mlir::failure();
389 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
391 return ::mlir::failure();
393 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
394 result.addTypes(odsBuildableType0);
395 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
396 return ::mlir::failure();
397 if (parser.resolveOperands(dimOperands, odsBuildableType0, dimOperandsLoc, result.operands))
398 return ::mlir::failure();
399 return ::mlir::success();
408 _odsPrinter <<
' ' <<
":";
412 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
413 _odsPrinter.printStrippedAttrOrType(validType);
417 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
418 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
443 for (
unsigned i = 0; i < index; ++i)
444 start += sizeAttr[i];
445 return {start, sizeAttr[index]};
449 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(
getProperties().numDimsPerMap);
469 if (!tblgen_mapOpGroupSizes)
return emitError(loc,
"'array.new' op requires attribute 'mapOpGroupSizes'");
472 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
473 return emitError(loc,
"'array.new' op attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
475 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
476 return emitError(loc,
"'array.new' op attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
477 return ::mlir::success();
481 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
484 for (
unsigned i = 0; i < index; ++i)
485 start += sizeAttr[i];
486 return {start, sizeAttr[index]};
491 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
497 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
502 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
504 emitError() <<
"expected DictionaryAttr to set properties";
505 return ::mlir::failure();
510 auto attr = dict.get(
"mapOpGroupSizes");
512 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
514 propStorage = convertedAttr;
516 emitError() <<
"Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
517 return ::mlir::failure();
524 auto attr = dict.get(
"numDimsPerMap");
526 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
528 propStorage = convertedAttr;
530 emitError() <<
"Invalid attribute `numDimsPerMap` in property conversion: " << attr;
531 return ::mlir::failure();
537 auto setFromAttr = [] (
auto &propStorage, ::mlir::Attribute propAttr,
538 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {
539 return convertFromAttribute(propStorage, propAttr, emitError);
541 auto attr = dict.get(
"operandSegmentSizes");
if (!attr) attr = dict.get(
"operand_segment_sizes");;
544 return emitError() <<
"for `operandSegmentSizes`: ";
546 return ::mlir::failure();
548 return ::mlir::success();
552 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
553 ::mlir::Builder odsBuilder{ctx};
558 attrs.push_back(odsBuilder.getNamedAttr(
"mapOpGroupSizes",
565 attrs.push_back(odsBuilder.getNamedAttr(
"numDimsPerMap",
571 auto attr = [&]() -> ::mlir::Attribute {
572 return ::mlir::DenseI32ArrayAttr::get(ctx, propStorage);
574 attrs.push_back(odsBuilder.getNamedAttr(
"operandSegmentSizes", attr));
578 return odsBuilder.getDictionaryAttr(attrs);
583 auto hash_operandSegmentSizes_ = [] (
const auto &propStorage) -> llvm::hash_code {
584 using ::llvm::hash_value;
585 return ::llvm::hash_combine_range(std::begin(propStorage), std::end(propStorage));;
587 using llvm::hash_value;
588 return llvm::hash_combine(
595 if (name ==
"mapOpGroupSizes")
598 if (name ==
"numDimsPerMap")
600 if (name ==
"operand_segment_sizes" || name ==
"operandSegmentSizes")
return [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.
operandSegmentSizes); }();
605 if (name ==
"mapOpGroupSizes") {
610 if (name ==
"numDimsPerMap") {
614 if (name ==
"operand_segment_sizes" || name ==
"operandSegmentSizes") {
615 auto arrAttr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(value);
616 if (!arrAttr)
return;
628 attrs.append(
"operandSegmentSizes", [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.
operandSegmentSizes); }());
634 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"mapOpGroupSizes", emitError)))
635 return ::mlir::failure();
640 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr,
"numDimsPerMap", emitError)))
641 return ::mlir::failure();
643 return ::mlir::success();
647 auto &prop = state.getOrAddProperties<
Properties>(); (void)prop;
649 return ::mlir::failure();
651 if (::mlir::failed(reader.readOptionalAttribute(prop.
numDimsPerMap)))
652 return ::mlir::failure();
654 if (reader.getBytecodeVersion() < 6) {
656 ::mlir::DenseI32ArrayAttr attr;
657 if (::mlir::failed(reader.readAttribute(attr))) return ::mlir::failure();
658 if (attr.size() >
static_cast<int64_t
>(
sizeof(propStorage) /
sizeof(int32_t))) {
659 reader.emitError(
"size mismatch for operand/result_segment_size");
660 return ::mlir::failure();
662 ::llvm::copy(::llvm::ArrayRef<int32_t>(attr), propStorage.begin());
667 auto readProp = [&]() {
669 if (reader.getBytecodeVersion() >= 6)
670 return reader.readSparseArray(::llvm::MutableArrayRef(propStorage));
672 return ::mlir::success();
674 if (::mlir::failed(readProp()))
675 return ::mlir::failure();
677 return ::mlir::success();
681 auto &prop = getProperties(); (void)prop;
686if (writer.getBytecodeVersion() < 6) {
688 writer.writeAttribute(::mlir::DenseI32ArrayAttr::get(this->getContext(), propStorage));
694 if (writer.getBytecodeVersion() >= 6)
695 writer.writeSparseArray(::llvm::ArrayRef(propStorage));
711 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
715 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
720 build(builder, __state__, std::forward<
decltype(result)>(result), std::forward<
decltype(elements)>(elements));
721 auto __res__ = ::llvm::dyn_cast<CreateArrayOp>(builder.create(__state__));
722 assert(__res__ &&
"builder didn't return the right type");
727 return create(builder, builder.getLoc(), std::forward<
decltype(result)>(result), std::forward<
decltype(elements)>(elements));
732 build(builder, __state__, std::forward<
decltype(result)>(result), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap));
733 auto __res__ = ::llvm::dyn_cast<CreateArrayOp>(builder.create(__state__));
734 assert(__res__ &&
"builder didn't return the right type");
739 return create(builder, builder.getLoc(), std::forward<
decltype(result)>(result), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap));
743 build(odsBuilder, odsState, result, mapOperands, odsBuilder.getDenseI32ArrayAttr(numDimsPerMap));
749 build(builder, __state__, std::forward<
decltype(result)>(result), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap));
750 auto __res__ = ::llvm::dyn_cast<CreateArrayOp>(builder.create(__state__));
751 assert(__res__ &&
"builder didn't return the right type");
756 return create(builder, builder.getLoc(), std::forward<
decltype(result)>(result), std::forward<
decltype(mapOperands)>(mapOperands), std::forward<
decltype(numDimsPerMap)>(numDimsPerMap));
760 ::mlir::Builder odsBuilder(opName.getContext());
762 properties.
numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
766 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
767 if (!tblgen_mapOpGroupSizes)
return emitOpError(
"requires attribute 'mapOpGroupSizes'");
768 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
770 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_numDimsPerMap,
"numDimsPerMap")))
771 return ::mlir::failure();
773 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*
this, tblgen_mapOpGroupSizes,
"mapOpGroupSizes")))
774 return ::mlir::failure();
776 unsigned index = 0; (void)index;
779 for (
auto v : valueGroup0) {
780 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*
this, v.getType(),
"operand", index++)))
781 return ::mlir::failure();
784 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*
this,
"mapOpGroupSizes",
"mapOperands", valueGroup1.size())))
785 return ::mlir::failure();
787 for (
auto v : valueGroup1) {
788 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
789 return ::mlir::failure();
793 unsigned index = 0; (void)index;
796 for (
auto v : valueGroup0) {
797 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
798 return ::mlir::failure();
802 return emitOpError(
"failed to verify that operand types match result type");
803 return ::mlir::success();
808 return ::mlir::success();
809 return ::mlir::failure();
813 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> mapOperandsOperands;
814 llvm::SmallVector<int32_t> mapOperandsOperandGroupSizes;
815 ::llvm::SMLoc mapOperandsOperandsLoc;
816 (void)mapOperandsOperandsLoc;
817 ::mlir::DenseI32ArrayAttr numDimsPerMapAttr;
818 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> elementsOperands;
819 ::llvm::SMLoc elementsOperandsLoc;
820 (void)elementsOperandsLoc;
821 ::mlir::Type resultRawType{};
822 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
823 ::llvm::SmallVector<::mlir::Type, 1> elementsTypes;
824 if (::mlir::succeeded(parser.parseOptionalLBrace())) {
826 mapOperandsOperandsLoc = parser.getCurrentLocation();
827 ::llvm::SmallVector<::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand>> mapOperandsOperandGroups;
829 if (odsResult) return ::mlir::failure();
830 for (
const auto &subRange : mapOperandsOperandGroups) {
831 mapOperandsOperands.append(subRange.begin(), subRange.end());
832 mapOperandsOperandGroupSizes.push_back(subRange.size());
834 if (numDimsPerMapAttr)
837 if (parser.parseRBrace())
838 return ::mlir::failure();
841 elementsOperandsLoc = parser.getCurrentLocation();
842 if (parser.parseOperandList(elementsOperands))
843 return ::mlir::failure();
845 if (parser.parseColon())
846 return ::mlir::failure();
850 if (parser.parseCustomTypeWithFallback(type))
851 return ::mlir::failure();
852 resultRawType = type;
855 auto odsResult = parseInferredArrayType(parser, elementsTypes, elementsOperands, resultRawType);
856 if (odsResult) return ::mlir::failure();
860 if (odsResult) return ::mlir::failure();
862::llvm::copy(::llvm::ArrayRef<int32_t>({
static_cast<int32_t
>(elementsOperands.size()),
static_cast<int32_t
>(mapOperandsOperands.size())}), result.getOrAddProperties<
CreateArrayOp::Properties>().operandSegmentSizes.begin());
863 result.getOrAddProperties<
CreateArrayOp::Properties>().mapOpGroupSizes = parser.getBuilder().getDenseI32ArrayAttr(mapOperandsOperandGroupSizes);
864 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
865 result.addTypes(resultTypes);
866 if (parser.resolveOperands(elementsOperands, elementsTypes, elementsOperandsLoc, result.operands))
867 return ::mlir::failure();
868 if (parser.resolveOperands(mapOperandsOperands, odsBuildableType0, mapOperandsOperandsLoc, result.operands))
869 return ::mlir::failure();
870 return ::mlir::success();
874 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
876 emitError() <<
"expected DictionaryAttr to set properties";
877 return ::mlir::failure();
881 ::mlir::DenseSet<::mlir::StringAttr> usedKeys;
882 ::mlir::MLIRContext *ctx = dict.getContext();
887 auto mapOpGroupSizesAttrName = ::mlir::StringAttr::get(ctx,
"mapOpGroupSizes");
888 auto attr = dict.get(mapOpGroupSizesAttrName);
889 usedKeys.insert(mapOpGroupSizesAttrName);
892 emitError() <<
"expected key entry for mapOpGroupSizes in DictionaryAttr to set "
894 return ::mlir::failure();
896 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<
decltype(propStorage)>>(attr);
898 propStorage = convertedAttr;
900 emitError() <<
"Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
901 return ::mlir::failure();
906 for (::mlir::NamedAttribute attr : dict) {
907 if (!usedKeys.contains(attr.getName()))
908 return emitError() <<
"unknown key '" << attr.getName() <<
909 "' when parsing properties dictionary";
911 return ::mlir::success();
923 _odsPrinter <<
' ' <<
":";
927 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
928 _odsPrinter.printStrippedAttrOrType(validType);
938 effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), 0,
false, ::llzk::DiscardableAllocationResource::get());
958 bool isVariadic[] = {
false,
true};
959 int prevVariadicCount = 0;
960 for (
unsigned i = 0; i < index; ++i)
961 if (isVariadic[i]) ++prevVariadicCount;
965 int variadicSize = (odsOperandsSize - 1) / 1;
970 int start = index + (variadicSize - 1) * prevVariadicCount;
971 int size = isVariadic[index] ? variadicSize : 1;
972 return {start, size};
980 return ::mlir::success();
984 bool isVariadic[] = {
false,
true};
985 int prevVariadicCount = 0;
986 for (
unsigned i = 0; i < index; ++i)
987 if (isVariadic[i]) ++prevVariadicCount;
991 int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
996 int start = index + (variadicSize - 1) * prevVariadicCount;
997 int size = isVariadic[index] ? variadicSize : 1;
998 return {start, size};
1003 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1004 return mutableRange;
1008 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1010 emitError() <<
"expected DictionaryAttr to set properties";
1011 return ::mlir::failure();
1013 return ::mlir::success();
1017 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1018 ::mlir::Builder odsBuilder{ctx};
1021 return odsBuilder.getDictionaryAttr(attrs);
1026 using llvm::hash_value;
1027 return llvm::hash_combine();
1031 return std::nullopt;
1041 return ::mlir::success();
1044void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1045 odsState.addOperands(arr_ref);
1046 odsState.addOperands(indices);
1047 odsState.addTypes(result);
1052 build(builder, __state__, std::forward<
decltype(result)>(result), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1053 auto __res__ = ::llvm::dyn_cast<ExtractArrayOp>(builder.create(__state__));
1054 assert(__res__ &&
"builder didn't return the right type");
1059 return create(builder, builder.getLoc(), std::forward<
decltype(result)>(result), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1062void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1063 odsState.addOperands(arr_ref);
1064 odsState.addOperands(indices);
1066 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1068 odsState.location, odsState.operands,
1069 odsState.attributes.getDictionary(odsState.getContext()),
1070 odsState.getRawProperties(),
1071 odsState.regions, inferredReturnTypes)))
1072 odsState.addTypes(inferredReturnTypes);
1074 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1080 build(builder, __state__, std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1081 auto __res__ = ::llvm::dyn_cast<ExtractArrayOp>(builder.create(__state__));
1082 assert(__res__ &&
"builder didn't return the right type");
1087 return create(builder, builder.getLoc(), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1090void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1091 odsState.addOperands(arr_ref);
1092 odsState.addOperands(indices);
1093 assert(resultTypes.size() == 1u &&
"mismatched number of results");
1094 odsState.addTypes(resultTypes);
1099 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1100 auto __res__ = ::llvm::dyn_cast<ExtractArrayOp>(builder.create(__state__));
1101 assert(__res__ &&
"builder didn't return the right type");
1106 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1109void ExtractArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1110 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1111 odsState.addOperands(operands);
1112 odsState.addAttributes(attributes);
1113 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
1114 odsState.addTypes(resultTypes);
1117ExtractArrayOp ExtractArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1119 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1120 auto __res__ = ::llvm::dyn_cast<ExtractArrayOp>(builder.create(__state__));
1121 assert(__res__ &&
"builder didn't return the right type");
1126 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1129void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1130 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1131 odsState.addOperands(operands);
1132 odsState.addAttributes(attributes);
1134 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1136 odsState.location, operands,
1137 odsState.attributes.getDictionary(odsState.getContext()),
1138 odsState.getRawProperties(),
1139 odsState.regions, inferredReturnTypes))) {
1140 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
1141 odsState.addTypes(inferredReturnTypes);
1143 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1149 build(builder, __state__, std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1150 auto __res__ = ::llvm::dyn_cast<ExtractArrayOp>(builder.create(__state__));
1151 assert(__res__ &&
"builder didn't return the right type");
1156 return create(builder, builder.getLoc(), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1159void ExtractArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1160 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1161 odsState.addOperands(operands);
1162 odsState.useProperties(
const_cast<Properties&
>(properties));
1163 odsState.addAttributes(discardableAttributes);
1164 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
1165 odsState.addTypes(resultTypes);
1168ExtractArrayOp ExtractArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1170 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1171 auto __res__ = ::llvm::dyn_cast<ExtractArrayOp>(builder.create(__state__));
1172 assert(__res__ &&
"builder didn't return the right type");
1177 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));
1180void ExtractArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1181 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1182 odsState.addOperands(operands);
1183 odsState.useProperties(
const_cast<Properties &
>(properties));
1184 odsState.addAttributes(discardableAttributes);
1186 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1188 odsState.location, operands,
1189 odsState.attributes.getDictionary(odsState.getContext()),
1190 odsState.getRawProperties(),
1191 odsState.regions, inferredReturnTypes))) {
1192 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
1193 odsState.addTypes(inferredReturnTypes);
1195 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1201 build(builder, __state__, std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1202 auto __res__ = ::llvm::dyn_cast<ExtractArrayOp>(builder.create(__state__));
1203 assert(__res__ &&
"builder didn't return the right type");
1208 return create(builder, builder.getLoc(), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1213 unsigned index = 0; (void)index;
1216 for (
auto v : valueGroup0) {
1217 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1218 return ::mlir::failure();
1222 for (
auto v : valueGroup1) {
1223 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
1224 return ::mlir::failure();
1228 unsigned index = 0; (void)index;
1231 for (
auto v : valueGroup0) {
1232 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"result", index++)))
1233 return ::mlir::failure();
1236 return ::mlir::success();
1244 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
1245 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
1246 (void)arr_refOperandsLoc;
1247 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
1248 ::llvm::SMLoc indicesOperandsLoc;
1249 (void)indicesOperandsLoc;
1250 ::mlir::Type arr_refRawType{};
1251 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
1253 arr_refOperandsLoc = parser.getCurrentLocation();
1254 if (parser.parseOperand(arr_refRawOperand))
1255 return ::mlir::failure();
1256 if (parser.parseLSquare())
1257 return ::mlir::failure();
1259 indicesOperandsLoc = parser.getCurrentLocation();
1260 if (parser.parseOperandList(indicesOperands))
1261 return ::mlir::failure();
1262 if (parser.parseRSquare())
1263 return ::mlir::failure();
1264 if (parser.parseColon())
1265 return ::mlir::failure();
1269 if (parser.parseCustomTypeWithFallback(type))
1270 return ::mlir::failure();
1271 arr_refRawType = type;
1274 auto loc = parser.getCurrentLocation();(void)loc;
1275 if (parser.parseOptionalAttrDict(result.attributes))
1276 return ::mlir::failure();
1278 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
1280 return ::mlir::failure();
1282 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1283 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
1284 return ::mlir::failure();
1285 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
1286 return ::mlir::failure();
1288 ::llvm::SmallVector<::mlir::Type> inferredReturnTypes;
1290 result.location, result.operands,
1291 result.attributes.getDictionary(parser.getContext()),
1292 result.getRawProperties(),
1293 result.regions, inferredReturnTypes)))
1294 return ::mlir::failure();
1295 result.addTypes(inferredReturnTypes);
1296 return ::mlir::success();
1305 _odsPrinter <<
' ' <<
":";
1309 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
1310 _odsPrinter.printStrippedAttrOrType(validType);
1312 _odsPrinter << type;
1314 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1315 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1318 ::llvm::LogicalResult
1320 std::optional<::mlir::Location> location,
1321 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
1322 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
1323 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
1326 location, adaptor, inferredReturnTypes);
1350 bool isVariadic[] = {
false,
true,
false};
1351 int prevVariadicCount = 0;
1352 for (
unsigned i = 0; i < index; ++i)
1353 if (isVariadic[i]) ++prevVariadicCount;
1357 int variadicSize = (odsOperandsSize - 2) / 1;
1362 int start = index + (variadicSize - 1) * prevVariadicCount;
1363 int size = isVariadic[index] ? variadicSize : 1;
1364 return {start, size};
1372 return ::mlir::success();
1376 bool isVariadic[] = {
false,
true,
false};
1377 int prevVariadicCount = 0;
1378 for (
unsigned i = 0; i < index; ++i)
1379 if (isVariadic[i]) ++prevVariadicCount;
1383 int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
1388 int start = index + (variadicSize - 1) * prevVariadicCount;
1389 int size = isVariadic[index] ? variadicSize : 1;
1390 return {start, size};
1395 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1396 return mutableRange;
1400 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1402 emitError() <<
"expected DictionaryAttr to set properties";
1403 return ::mlir::failure();
1405 return ::mlir::success();
1409 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1410 ::mlir::Builder odsBuilder{ctx};
1413 return odsBuilder.getDictionaryAttr(attrs);
1418 using llvm::hash_value;
1419 return llvm::hash_combine();
1423 return std::nullopt;
1433 return ::mlir::success();
1436void InsertArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
1437 odsState.addOperands(arr_ref);
1438 odsState.addOperands(indices);
1439 odsState.addOperands(rvalue);
1444 build(builder, __state__, std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
1445 auto __res__ = ::llvm::dyn_cast<InsertArrayOp>(builder.create(__state__));
1446 assert(__res__ &&
"builder didn't return the right type");
1451 return create(builder, builder.getLoc(), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
1454void InsertArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
1455 odsState.addOperands(arr_ref);
1456 odsState.addOperands(indices);
1457 odsState.addOperands(rvalue);
1458 assert(resultTypes.size() == 0u &&
"mismatched number of results");
1459 odsState.addTypes(resultTypes);
1462InsertArrayOp InsertArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
1464 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
1465 auto __res__ = ::llvm::dyn_cast<InsertArrayOp>(builder.create(__state__));
1466 assert(__res__ &&
"builder didn't return the right type");
1471 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
1474void InsertArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1475 assert(operands.size() >= 2u &&
"mismatched number of parameters");
1476 odsState.addOperands(operands);
1477 odsState.addAttributes(attributes);
1478 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1479 odsState.addTypes(resultTypes);
1482InsertArrayOp InsertArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1484 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1485 auto __res__ = ::llvm::dyn_cast<InsertArrayOp>(builder.create(__state__));
1486 assert(__res__ &&
"builder didn't return the right type");
1490InsertArrayOp InsertArrayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1491 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1494void InsertArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1495 assert(operands.size() >= 2u &&
"mismatched number of parameters");
1496 odsState.addOperands(operands);
1497 odsState.useProperties(
const_cast<Properties&
>(properties));
1498 odsState.addAttributes(discardableAttributes);
1499 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
1500 odsState.addTypes(resultTypes);
1503InsertArrayOp InsertArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1505 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1506 auto __res__ = ::llvm::dyn_cast<InsertArrayOp>(builder.create(__state__));
1507 assert(__res__ &&
"builder didn't return the right type");
1512 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));
1517 unsigned index = 0; (void)index;
1520 for (
auto v : valueGroup0) {
1521 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1522 return ::mlir::failure();
1526 for (
auto v : valueGroup1) {
1527 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
1528 return ::mlir::failure();
1532 for (
auto v : valueGroup2) {
1533 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1534 return ::mlir::failure();
1537 return ::mlir::success();
1542 return ::mlir::success();
1543 return ::mlir::failure();
1547 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
1548 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
1549 (void)arr_refOperandsLoc;
1550 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
1551 ::llvm::SMLoc indicesOperandsLoc;
1552 (void)indicesOperandsLoc;
1553 ::mlir::OpAsmParser::UnresolvedOperand rvalueRawOperand{};
1554 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rvalueOperands(&rvalueRawOperand, 1); ::llvm::SMLoc rvalueOperandsLoc;
1555 (void)rvalueOperandsLoc;
1556 ::mlir::Type arr_refRawType{};
1557 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
1558 ::mlir::Type rvalueRawType{};
1559 ::llvm::ArrayRef<::mlir::Type> rvalueTypes(&rvalueRawType, 1);
1561 arr_refOperandsLoc = parser.getCurrentLocation();
1562 if (parser.parseOperand(arr_refRawOperand))
1563 return ::mlir::failure();
1564 if (parser.parseLSquare())
1565 return ::mlir::failure();
1567 indicesOperandsLoc = parser.getCurrentLocation();
1568 if (parser.parseOperandList(indicesOperands))
1569 return ::mlir::failure();
1570 if (parser.parseRSquare())
1571 return ::mlir::failure();
1572 if (parser.parseEqual())
1573 return ::mlir::failure();
1575 rvalueOperandsLoc = parser.getCurrentLocation();
1576 if (parser.parseOperand(rvalueRawOperand))
1577 return ::mlir::failure();
1578 if (parser.parseColon())
1579 return ::mlir::failure();
1583 if (parser.parseCustomTypeWithFallback(type))
1584 return ::mlir::failure();
1585 arr_refRawType = type;
1587 if (parser.parseComma())
1588 return ::mlir::failure();
1592 if (parser.parseCustomTypeWithFallback(type))
1593 return ::mlir::failure();
1594 rvalueRawType = type;
1597 auto loc = parser.getCurrentLocation();(void)loc;
1598 if (parser.parseOptionalAttrDict(result.attributes))
1599 return ::mlir::failure();
1601 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
1603 return ::mlir::failure();
1605 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
1606 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
1607 return ::mlir::failure();
1608 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
1609 return ::mlir::failure();
1610 if (parser.resolveOperands(rvalueOperands, rvalueTypes, rvalueOperandsLoc, result.operands))
1611 return ::mlir::failure();
1612 return ::mlir::success();
1621 _odsPrinter <<
' ' <<
"=";
1624 _odsPrinter <<
' ' <<
":";
1628 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
1629 _odsPrinter.printStrippedAttrOrType(validType);
1631 _odsPrinter << type;
1637 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
1638 _odsPrinter.printStrippedAttrOrType(validType);
1640 _odsPrinter << type;
1642 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1643 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1666 bool isVariadic[] = {
false,
true};
1667 int prevVariadicCount = 0;
1668 for (
unsigned i = 0; i < index; ++i)
1669 if (isVariadic[i]) ++prevVariadicCount;
1673 int variadicSize = (odsOperandsSize - 1) / 1;
1678 int start = index + (variadicSize - 1) * prevVariadicCount;
1679 int size = isVariadic[index] ? variadicSize : 1;
1680 return {start, size};
1688 return ::mlir::success();
1692 bool isVariadic[] = {
false,
true};
1693 int prevVariadicCount = 0;
1694 for (
unsigned i = 0; i < index; ++i)
1695 if (isVariadic[i]) ++prevVariadicCount;
1699 int variadicSize = (getOperation()->getNumOperands() - 1) / 1;
1704 int start = index + (variadicSize - 1) * prevVariadicCount;
1705 int size = isVariadic[index] ? variadicSize : 1;
1706 return {start, size};
1711 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
1712 return mutableRange;
1716 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
1718 emitError() <<
"expected DictionaryAttr to set properties";
1719 return ::mlir::failure();
1721 return ::mlir::success();
1725 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
1726 ::mlir::Builder odsBuilder{ctx};
1729 return odsBuilder.getDictionaryAttr(attrs);
1734 using llvm::hash_value;
1735 return llvm::hash_combine();
1739 return std::nullopt;
1748::llvm::LogicalResult
ReadArrayOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
1749 return ::mlir::success();
1752void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1753 odsState.addOperands(arr_ref);
1754 odsState.addOperands(indices);
1755 odsState.addTypes(result);
1760 build(builder, __state__, std::forward<
decltype(result)>(result), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1761 auto __res__ = ::llvm::dyn_cast<ReadArrayOp>(builder.create(__state__));
1762 assert(__res__ &&
"builder didn't return the right type");
1767 return create(builder, builder.getLoc(), std::forward<
decltype(result)>(result), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1770void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1771 odsState.addOperands(arr_ref);
1772 odsState.addOperands(indices);
1774 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1776 odsState.location, odsState.operands,
1777 odsState.attributes.getDictionary(odsState.getContext()),
1778 odsState.getRawProperties(),
1779 odsState.regions, inferredReturnTypes)))
1780 odsState.addTypes(inferredReturnTypes);
1782 ::mlir::detail::reportFatalInferReturnTypesError(odsState);
1788 build(builder, __state__, std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1789 auto __res__ = ::llvm::dyn_cast<ReadArrayOp>(builder.create(__state__));
1790 assert(__res__ &&
"builder didn't return the right type");
1795 return create(builder, builder.getLoc(), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1798void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1799 odsState.addOperands(arr_ref);
1800 odsState.addOperands(indices);
1801 assert(resultTypes.size() == 1u &&
"mismatched number of results");
1802 odsState.addTypes(resultTypes);
1805ReadArrayOp ReadArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices) {
1807 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1808 auto __res__ = ::llvm::dyn_cast<ReadArrayOp>(builder.create(__state__));
1809 assert(__res__ &&
"builder didn't return the right type");
1814 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices));
1817void ReadArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1818 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1819 odsState.addOperands(operands);
1820 odsState.addAttributes(attributes);
1821 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
1822 odsState.addTypes(resultTypes);
1825ReadArrayOp ReadArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1827 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1828 auto __res__ = ::llvm::dyn_cast<ReadArrayOp>(builder.create(__state__));
1829 assert(__res__ &&
"builder didn't return the right type");
1833ReadArrayOp ReadArrayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1834 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1837void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1838 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1839 odsState.addOperands(operands);
1840 odsState.addAttributes(attributes);
1842 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1844 odsState.location, operands,
1845 odsState.attributes.getDictionary(odsState.getContext()),
1846 odsState.getRawProperties(),
1847 odsState.regions, inferredReturnTypes))) {
1848 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
1849 odsState.addTypes(inferredReturnTypes);
1851 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1855ReadArrayOp ReadArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1857 build(builder, __state__, std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1858 auto __res__ = ::llvm::dyn_cast<ReadArrayOp>(builder.create(__state__));
1859 assert(__res__ &&
"builder didn't return the right type");
1864 return create(builder, builder.getLoc(), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
1867void ReadArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1868 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1869 odsState.addOperands(operands);
1870 odsState.useProperties(
const_cast<Properties&
>(properties));
1871 odsState.addAttributes(discardableAttributes);
1872 assert(resultTypes.size() == 1u &&
"mismatched number of return types");
1873 odsState.addTypes(resultTypes);
1876ReadArrayOp ReadArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1878 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1879 auto __res__ = ::llvm::dyn_cast<ReadArrayOp>(builder.create(__state__));
1880 assert(__res__ &&
"builder didn't return the right type");
1884ReadArrayOp ReadArrayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1885 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));
1888void ReadArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
1889 assert(operands.size() >= 1u &&
"mismatched number of parameters");
1890 odsState.addOperands(operands);
1891 odsState.useProperties(
const_cast<Properties &
>(properties));
1892 odsState.addAttributes(discardableAttributes);
1894 ::llvm::SmallVector<::mlir::Type, 2> inferredReturnTypes;
1896 odsState.location, operands,
1897 odsState.attributes.getDictionary(odsState.getContext()),
1898 odsState.getRawProperties(),
1899 odsState.regions, inferredReturnTypes))) {
1900 assert(inferredReturnTypes.size() == 1u &&
"mismatched number of return types");
1901 odsState.addTypes(inferredReturnTypes);
1903 ::llvm::report_fatal_error(
"Failed to infer result type(s).");
1909 build(builder, __state__, std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1910 auto __res__ = ::llvm::dyn_cast<ReadArrayOp>(builder.create(__state__));
1911 assert(__res__ &&
"builder didn't return the right type");
1916 return create(builder, builder.getLoc(), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
1921 unsigned index = 0; (void)index;
1924 for (
auto v : valueGroup0) {
1925 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
1926 return ::mlir::failure();
1930 for (
auto v : valueGroup1) {
1931 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
1932 return ::mlir::failure();
1936 unsigned index = 0; (void)index;
1939 for (
auto v : valueGroup0) {
1940 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops5(*
this, v.getType(),
"result", index++)))
1941 return ::mlir::failure();
1945 return emitOpError(
"failed to verify that result type matches with arr_ref element type");
1946 return ::mlir::success();
1951 return ::mlir::success();
1952 return ::mlir::failure();
1956 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
1957 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
1958 (void)arr_refOperandsLoc;
1959 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
1960 ::llvm::SMLoc indicesOperandsLoc;
1961 (void)indicesOperandsLoc;
1962 ::mlir::Type arr_refRawType{};
1963 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
1964 ::mlir::Type resultRawType{};
1965 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
1967 arr_refOperandsLoc = parser.getCurrentLocation();
1968 if (parser.parseOperand(arr_refRawOperand))
1969 return ::mlir::failure();
1970 if (parser.parseLSquare())
1971 return ::mlir::failure();
1973 indicesOperandsLoc = parser.getCurrentLocation();
1974 if (parser.parseOperandList(indicesOperands))
1975 return ::mlir::failure();
1976 if (parser.parseRSquare())
1977 return ::mlir::failure();
1978 if (parser.parseColon())
1979 return ::mlir::failure();
1983 if (parser.parseCustomTypeWithFallback(type))
1984 return ::mlir::failure();
1985 arr_refRawType = type;
1987 if (parser.parseComma())
1988 return ::mlir::failure();
1992 if (parser.parseCustomTypeWithFallback(type))
1993 return ::mlir::failure();
1994 resultRawType = type;
1997 auto loc = parser.getCurrentLocation();(void)loc;
1998 if (parser.parseOptionalAttrDict(result.attributes))
1999 return ::mlir::failure();
2001 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
2003 return ::mlir::failure();
2005 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
2006 result.addTypes(resultTypes);
2007 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
2008 return ::mlir::failure();
2009 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
2010 return ::mlir::failure();
2011 return ::mlir::success();
2020 _odsPrinter <<
' ' <<
":";
2024 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
2025 _odsPrinter.printStrippedAttrOrType(validType);
2027 _odsPrinter << type;
2033 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
2034 _odsPrinter.printStrippedAttrOrType(validType);
2036 _odsPrinter << type;
2038 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2039 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2042 ::llvm::LogicalResult
2044 std::optional<::mlir::Location> location,
2045 ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes,
2046 ::mlir::PropertyRef properties, ::mlir::RegionRange regions,
2047 ::llvm::SmallVectorImpl<::mlir::Type> &inferredReturnTypes) {
2050 location, adaptor, inferredReturnTypes);
2056 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
2057 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
2058 const ::mlir::DataLayout &dataLayout) {
2059 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
2060 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
2065 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
2066 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
2067 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
2068 .rewire(slot, subslots, builder, dataLayout);
2083 ::mlir::Value, const ::mlir::DataLayout &) {
2084 llvm_unreachable(
"getStored() should not be called on ReadArrayOp");
2122 bool isVariadic[] = {
false,
true,
false};
2123 int prevVariadicCount = 0;
2124 for (
unsigned i = 0; i < index; ++i)
2125 if (isVariadic[i]) ++prevVariadicCount;
2129 int variadicSize = (odsOperandsSize - 2) / 1;
2134 int start = index + (variadicSize - 1) * prevVariadicCount;
2135 int size = isVariadic[index] ? variadicSize : 1;
2136 return {start, size};
2144 return ::mlir::success();
2148 bool isVariadic[] = {
false,
true,
false};
2149 int prevVariadicCount = 0;
2150 for (
unsigned i = 0; i < index; ++i)
2151 if (isVariadic[i]) ++prevVariadicCount;
2155 int variadicSize = (getOperation()->getNumOperands() - 2) / 1;
2160 int start = index + (variadicSize - 1) * prevVariadicCount;
2161 int size = isVariadic[index] ? variadicSize : 1;
2162 return {start, size};
2167 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second);
2168 return mutableRange;
2172 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
2174 emitError() <<
"expected DictionaryAttr to set properties";
2175 return ::mlir::failure();
2177 return ::mlir::success();
2181 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
2182 ::mlir::Builder odsBuilder{ctx};
2185 return odsBuilder.getDictionaryAttr(attrs);
2190 using llvm::hash_value;
2191 return llvm::hash_combine();
2195 return std::nullopt;
2205 return ::mlir::success();
2208void WriteArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
2209 odsState.addOperands(arr_ref);
2210 odsState.addOperands(indices);
2211 odsState.addOperands(rvalue);
2216 build(builder, __state__, std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
2217 auto __res__ = ::llvm::dyn_cast<WriteArrayOp>(builder.create(__state__));
2218 assert(__res__ &&
"builder didn't return the right type");
2223 return create(builder, builder.getLoc(), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
2226void WriteArrayOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
2227 odsState.addOperands(arr_ref);
2228 odsState.addOperands(indices);
2229 odsState.addOperands(rvalue);
2230 assert(resultTypes.size() == 0u &&
"mismatched number of results");
2231 odsState.addTypes(resultTypes);
2234WriteArrayOp WriteArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
2236 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
2237 auto __res__ = ::llvm::dyn_cast<WriteArrayOp>(builder.create(__state__));
2238 assert(__res__ &&
"builder didn't return the right type");
2242WriteArrayOp WriteArrayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue) {
2243 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(arr_ref)>(arr_ref), std::forward<
decltype(indices)>(indices), std::forward<
decltype(rvalue)>(rvalue));
2246void WriteArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2247 assert(operands.size() >= 2u &&
"mismatched number of parameters");
2248 odsState.addOperands(operands);
2249 odsState.addAttributes(attributes);
2250 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
2251 odsState.addTypes(resultTypes);
2254WriteArrayOp WriteArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2256 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
2257 auto __res__ = ::llvm::dyn_cast<WriteArrayOp>(builder.create(__state__));
2258 assert(__res__ &&
"builder didn't return the right type");
2262WriteArrayOp WriteArrayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
2263 return create(builder, builder.getLoc(), std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(attributes)>(attributes));
2266void WriteArrayOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2267 assert(operands.size() >= 2u &&
"mismatched number of parameters");
2268 odsState.addOperands(operands);
2269 odsState.useProperties(
const_cast<Properties&
>(properties));
2270 odsState.addAttributes(discardableAttributes);
2271 assert(resultTypes.size() == 0u &&
"mismatched number of return types");
2272 odsState.addTypes(resultTypes);
2275WriteArrayOp WriteArrayOp::create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2277 build(builder, __state__, std::forward<
decltype(resultTypes)>(resultTypes), std::forward<
decltype(operands)>(operands), std::forward<
decltype(properties)>(properties), std::forward<
decltype(discardableAttributes)>(discardableAttributes));
2278 auto __res__ = ::llvm::dyn_cast<WriteArrayOp>(builder.create(__state__));
2279 assert(__res__ &&
"builder didn't return the right type");
2283WriteArrayOp WriteArrayOp::create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands,
const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes) {
2284 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));
2289 unsigned index = 0; (void)index;
2292 for (
auto v : valueGroup0) {
2293 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*
this, v.getType(),
"operand", index++)))
2294 return ::mlir::failure();
2298 for (
auto v : valueGroup1) {
2299 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*
this, v.getType(),
"operand", index++)))
2300 return ::mlir::failure();
2304 for (
auto v : valueGroup2) {
2305 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops5(*
this, v.getType(),
"operand", index++)))
2306 return ::mlir::failure();
2310 return emitOpError(
"failed to verify that rvalue type matches with arr_ref element type");
2311 return ::mlir::success();
2316 return ::mlir::success();
2317 return ::mlir::failure();
2321 ::mlir::OpAsmParser::UnresolvedOperand arr_refRawOperand{};
2322 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> arr_refOperands(&arr_refRawOperand, 1); ::llvm::SMLoc arr_refOperandsLoc;
2323 (void)arr_refOperandsLoc;
2324 ::llvm::SmallVector<::mlir::OpAsmParser::UnresolvedOperand, 4> indicesOperands;
2325 ::llvm::SMLoc indicesOperandsLoc;
2326 (void)indicesOperandsLoc;
2327 ::mlir::OpAsmParser::UnresolvedOperand rvalueRawOperand{};
2328 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> rvalueOperands(&rvalueRawOperand, 1); ::llvm::SMLoc rvalueOperandsLoc;
2329 (void)rvalueOperandsLoc;
2330 ::mlir::Type arr_refRawType{};
2331 ::llvm::ArrayRef<::mlir::Type> arr_refTypes(&arr_refRawType, 1);
2332 ::mlir::Type rvalueRawType{};
2333 ::llvm::ArrayRef<::mlir::Type> rvalueTypes(&rvalueRawType, 1);
2335 arr_refOperandsLoc = parser.getCurrentLocation();
2336 if (parser.parseOperand(arr_refRawOperand))
2337 return ::mlir::failure();
2338 if (parser.parseLSquare())
2339 return ::mlir::failure();
2341 indicesOperandsLoc = parser.getCurrentLocation();
2342 if (parser.parseOperandList(indicesOperands))
2343 return ::mlir::failure();
2344 if (parser.parseRSquare())
2345 return ::mlir::failure();
2346 if (parser.parseEqual())
2347 return ::mlir::failure();
2349 rvalueOperandsLoc = parser.getCurrentLocation();
2350 if (parser.parseOperand(rvalueRawOperand))
2351 return ::mlir::failure();
2352 if (parser.parseColon())
2353 return ::mlir::failure();
2357 if (parser.parseCustomTypeWithFallback(type))
2358 return ::mlir::failure();
2359 arr_refRawType = type;
2361 if (parser.parseComma())
2362 return ::mlir::failure();
2366 if (parser.parseCustomTypeWithFallback(type))
2367 return ::mlir::failure();
2368 rvalueRawType = type;
2371 auto loc = parser.getCurrentLocation();(void)loc;
2372 if (parser.parseOptionalAttrDict(result.attributes))
2373 return ::mlir::failure();
2375 return parser.emitError(loc) <<
"'" << result.name.getStringRef() <<
"' op ";
2377 return ::mlir::failure();
2379 ::mlir::Type odsBuildableType0 = parser.getBuilder().getIndexType();
2380 if (parser.resolveOperands(arr_refOperands, arr_refTypes, arr_refOperandsLoc, result.operands))
2381 return ::mlir::failure();
2382 if (parser.resolveOperands(indicesOperands, odsBuildableType0, indicesOperandsLoc, result.operands))
2383 return ::mlir::failure();
2384 if (parser.resolveOperands(rvalueOperands, rvalueTypes, rvalueOperandsLoc, result.operands))
2385 return ::mlir::failure();
2386 return ::mlir::success();
2395 _odsPrinter <<
' ' <<
"=";
2398 _odsPrinter <<
' ' <<
":";
2402 if (
auto validType = ::llvm::dyn_cast<::llzk::array::ArrayType>(type))
2403 _odsPrinter.printStrippedAttrOrType(validType);
2405 _odsPrinter << type;
2411 if (
auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
2412 _odsPrinter.printStrippedAttrOrType(validType);
2414 _odsPrinter << type;
2416 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
2417 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
2422 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
2423 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
2424 const ::mlir::DataLayout &dataLayout) {
2425 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
2426 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
2431 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
2432 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
2433 return ::llvm::cast<ArrayAccessOpInterface>(getOperation())
2434 .rewire(slot, subslots, builder, dataLayout);
2449 ::mlir::Value, const ::mlir::DataLayout &) {
::llvm::LogicalResult verify(::mlir::Location loc)
ArrayLengthOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
ArrayLengthOpAdaptor(ArrayLengthOp op)
::mlir::ValueRange getOperands()
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::Operation::result_range getODSResults(unsigned index)
static constexpr ::llvm::StringLiteral getOperationName()
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location > location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::Operation::operand_range getODSOperands(unsigned index)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
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)
static llvm::hash_code computePropertiesHash(const Properties &prop)
::llvm::LogicalResult verifyInvariantsImpl()
FoldAdaptor::Properties Properties
static ArrayLengthOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type length, ::mlir::Value arr_ref, ::mlir::Value dim)
::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 CreateArrayOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::array::ArrayType result, ::mlir::ValueRange elements={})
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::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()
static constexpr ::llvm::StringLiteral getOperationName()
::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)
InsertArrayOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
InsertArrayOpAdaptor(InsertArrayOp op)
::mlir::ValueRange getOperands()
::mlir::Operation::operand_range getIndices()
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult verifyInvariantsImpl()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
bool isRead()
Return true if the op is a read, false if it's a write.
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::llvm::LogicalResult verifyInvariants()
static llvm::hash_code computePropertiesHash(const Properties &prop)
static constexpr ::llvm::StringLiteral getOperationName()
::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)
FoldAdaptor::Properties Properties
void print(::mlir::OpAsmPrinter &_odsPrinter)
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
static InsertArrayOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue)
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)
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
::mlir::MutableOperandRange getIndicesMutable()
ReadArrayOpAdaptor(ReadArrayOp op)
ReadArrayOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &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 verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
bool storesToDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
::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.
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
::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()
FoldAdaptor::Properties Properties
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
::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.
bool loadsFromDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::llvm::LogicalResult verify()
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value arr_ref, ::mlir::ValueRange indices)
static llvm::hash_code computePropertiesHash(const Properties &prop)
void print(::mlir::OpAsmPrinter &_odsPrinter)
::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::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type > &inferredReturnTypes)
::mlir::Operation::operand_range getODSOperands(unsigned index)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
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.
static ReadArrayOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value arr_ref, ::mlir::ValueRange indices)
static constexpr ::llvm::StringLiteral getOperationName()
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
ReadArrayOpAdaptor Adaptor
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::llvm::LogicalResult verifyInvariants()
::mlir::MutableOperandRange getIndicesMutable()
::llvm::LogicalResult verify(::mlir::Location loc)
WriteArrayOpAdaptor(WriteArrayOp op)
WriteArrayOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::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.
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
static llvm::hash_code computePropertiesHash(const Properties &prop)
::llvm::LogicalResult verifyInvariants()
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
::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.
static WriteArrayOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value arr_ref, ::mlir::ValueRange indices, ::mlir::Value rvalue)
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
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()
bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
bool loadsFromDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
static constexpr ::llvm::StringLiteral getOperationName()
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)
bool storesToDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
::mlir::MutableOperandRange getIndicesMutable()
FoldAdaptor::Properties Properties
::mlir::Operation::operand_range getODSOperands(unsigned index)
::mlir::TypedValue<::llzk::array::ArrayType > getArrRef()
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
::mlir::TypedValue<::mlir::Type > getRvalue()
::mlir::RegionRange odsRegions
ArrayLengthOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
const Properties & getProperties()
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
::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)
InsertArrayOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::RegionRange odsRegions
const Properties & getProperties()
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
::std::optional<::mlir::OperationName > odsOpName
::mlir::DictionaryAttr odsAttrs
::mlir::RegionRange odsRegions
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
ReadArrayOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
const Properties & getProperties()
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
const Properties & getProperties()
WriteArrayOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
::mlir::DictionaryAttr odsAttrs
::mlir::RegionRange odsRegions
::std::optional<::mlir::OperationName > odsOpName
Common interface for operations that reference an array value.
Common interface for constant parameter-like symbol operations that can be defined within a TemplateO...
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