LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10#ifdef GET_OP_LIST
11#undef GET_OP_LIST
12
16#endif // GET_OP_LIST
17
18#ifdef GET_OP_CLASSES
19#undef GET_OP_CLASSES
20
21
22//===----------------------------------------------------------------------===//
23// Local Utility Method Definitions
24//===----------------------------------------------------------------------===//
25
26namespace llzk {
27namespace pod {
28
29static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops1(
30 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
31 unsigned valueIndex) {
32 if (!((::llzk::isValidType(type)))) {
33 return op->emitOpError(valueKind) << " #" << valueIndex
34 << " must be variadic of a valid LLZK type, but got " << type;
35 }
36 return ::mlir::success();
37}
38
39static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops2(
40 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
41 unsigned valueIndex) {
42 if (!((::llvm::isa<::mlir::IndexType>(type)))) {
43 return op->emitOpError(valueKind) << " #" << valueIndex
44 << " must be variadic of index, but got " << type;
45 }
46 return ::mlir::success();
47}
48
49static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops3(
50 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
51 unsigned valueIndex) {
52 if (!((::llvm::isa<::llzk::pod::PodType>(type)))) {
53 return op->emitOpError(valueKind) << " #" << valueIndex
54 << " must be plain-old-data struct, but got " << type;
55 }
56 return ::mlir::success();
57}
58
59static ::llvm::LogicalResult __mlir_ods_local_type_constraint_Ops4(
60 ::mlir::Operation *op, ::mlir::Type type, ::llvm::StringRef valueKind,
61 unsigned valueIndex) {
62 if (!((::llzk::isValidType(type)))) {
63 return op->emitOpError(valueKind) << " #" << valueIndex
64 << " must be a valid LLZK type, but got " << type;
65 }
66 return ::mlir::success();
67}
68
69static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
70 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
71 if (attr && !(((::llvm::isa<::mlir::ArrayAttr>(attr))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(attr), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::StringAttr>(attr))); }))))
72 return emitError() << "attribute '" << attrName
73 << "' failed to satisfy constraint: string array attribute";
74 return ::mlir::success();
75}
76static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops1(
77 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
78 return __mlir_ods_local_attr_constraint_Ops1(attr, attrName, [op]() {
79 return op->emitOpError();
80 });
81}
82
83static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
84 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
85 if (attr && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(attr))))
86 return emitError() << "attribute '" << attrName
87 << "' failed to satisfy constraint: i32 dense array attribute";
88 return ::mlir::success();
89}
90static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops2(
91 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
92 return __mlir_ods_local_attr_constraint_Ops2(attr, attrName, [op]() {
93 return op->emitOpError();
94 });
95}
96
97static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
98 ::mlir::Attribute attr, ::llvm::StringRef attrName, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
99 if (attr && !((::llvm::isa<::mlir::StringAttr>(attr))))
100 return emitError() << "attribute '" << attrName
101 << "' failed to satisfy constraint: string attribute";
102 return ::mlir::success();
103}
104static ::llvm::LogicalResult __mlir_ods_local_attr_constraint_Ops3(
105 ::mlir::Operation *op, ::mlir::Attribute attr, ::llvm::StringRef attrName) {
106 return __mlir_ods_local_attr_constraint_Ops3(attr, attrName, [op]() {
107 return op->emitOpError();
108 });
109}
110} // namespace pod
111} // namespace llzk
112namespace llzk {
113namespace pod {
114
115//===----------------------------------------------------------------------===//
116// ::llzk::pod::NewPodOp definitions
117//===----------------------------------------------------------------------===//
118
119namespace detail {
120NewPodOpGenericAdaptorBase::NewPodOpGenericAdaptorBase(NewPodOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
121
122std::pair<unsigned, unsigned> NewPodOpGenericAdaptorBase::getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
123 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
124
125 unsigned start = 0;
126 for (unsigned i = 0; i < index; ++i)
127 start += sizeAttr[i];
128 return {start, sizeAttr[index]};
129}
130
132 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().initializedRecords);
133 return attr;
134}
135
137 auto attr = getInitializedRecordsAttr();
138 return attr;
139}
140
142 auto attr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
143 return attr;
144}
145
147 auto attr = getNumDimsPerMapAttr();
148 return attr;
149}
150
152 auto attr = getMapOpGroupSizesAttr();
153 return attr;
154}
155
156} // namespace detail
158
159::llvm::LogicalResult NewPodOpAdaptor::verify(::mlir::Location loc) {
160 auto tblgen_initializedRecords = getProperties().initializedRecords; (void)tblgen_initializedRecords;
161 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
162 if (!tblgen_mapOpGroupSizes) return emitError(loc, "'pod.new' op ""requires attribute 'mapOpGroupSizes'");
163 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
164
165 if (tblgen_initializedRecords && !(((::llvm::isa<::mlir::ArrayAttr>(tblgen_initializedRecords))) && (::llvm::all_of(::llvm::cast<::mlir::ArrayAttr>(tblgen_initializedRecords), [&](::mlir::Attribute attr) { return attr && ((::llvm::isa<::mlir::StringAttr>(attr))); }))))
166 return emitError(loc, "'pod.new' op ""attribute 'initializedRecords' failed to satisfy constraint: string array attribute");
167
168 if (tblgen_numDimsPerMap && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_numDimsPerMap))))
169 return emitError(loc, "'pod.new' op ""attribute 'numDimsPerMap' failed to satisfy constraint: i32 dense array attribute");
170
171 if (tblgen_mapOpGroupSizes && !((::llvm::isa<::mlir::DenseI32ArrayAttr>(tblgen_mapOpGroupSizes))))
172 return emitError(loc, "'pod.new' op ""attribute 'mapOpGroupSizes' failed to satisfy constraint: i32 dense array attribute");
173 return ::mlir::success();
174}
175
176std::pair<unsigned, unsigned> NewPodOp::getODSOperandIndexAndLength(unsigned index) {
177 ::llvm::ArrayRef<int32_t> sizeAttr = getProperties().operandSegmentSizes;
178
179 unsigned start = 0;
180 for (unsigned i = 0; i < index; ++i)
181 start += sizeAttr[i];
182 return {start, sizeAttr[index]};
183}
184
185::mlir::MutableOperandRange NewPodOp::getInitialValuesMutable() {
186 auto range = getODSOperandIndexAndLength(0);
187 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(0u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
188 return mutableRange;
189}
190
191::mlir::MutableOperandRangeRange NewPodOp::getMapOperandsMutable() {
192 auto range = getODSOperandIndexAndLength(1);
193 auto mutableRange = ::mlir::MutableOperandRange(getOperation(), range.first, range.second, ::mlir::MutableOperandRange::OperandSegment(1u, {getOperandSegmentSizesAttrName(), ::mlir::DenseI32ArrayAttr::get(getContext(), getProperties().operandSegmentSizes)}));
194 return mutableRange.split(*(*this)->getAttrDictionary().getNamed(getMapOpGroupSizesAttrName()));
195}
196
197::llvm::LogicalResult NewPodOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
198 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
199 if (!dict) {
200 emitError() << "expected DictionaryAttr to set properties";
201 return ::mlir::failure();
202 }
203
204 {
205 auto &propStorage = prop.initializedRecords;
206 auto attr = dict.get("initializedRecords");
207 if (attr) {
208 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
209 if (convertedAttr) {
210 propStorage = convertedAttr;
211 } else {
212 emitError() << "Invalid attribute `initializedRecords` in property conversion: " << attr;
213 return ::mlir::failure();
214 }
215 }
216 }
217
218 {
219 auto &propStorage = prop.mapOpGroupSizes;
220 auto attr = dict.get("mapOpGroupSizes");
221 if (attr) {
222 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
223 if (convertedAttr) {
224 propStorage = convertedAttr;
225 } else {
226 emitError() << "Invalid attribute `mapOpGroupSizes` in property conversion: " << attr;
227 return ::mlir::failure();
228 }
229 }
230 }
231
232 {
233 auto &propStorage = prop.numDimsPerMap;
234 auto attr = dict.get("numDimsPerMap");
235 if (attr) {
236 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
237 if (convertedAttr) {
238 propStorage = convertedAttr;
239 } else {
240 emitError() << "Invalid attribute `numDimsPerMap` in property conversion: " << attr;
241 return ::mlir::failure();
242 }
243 }
244 }
245{
246
247 auto setFromAttr = [] (auto &propStorage, ::mlir::Attribute propAttr,
248 ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) -> ::mlir::LogicalResult {
249 return convertFromAttribute(propStorage, propAttr, emitError);
250 };
251 auto attr = dict.get("operandSegmentSizes"); if (!attr) attr = dict.get("operand_segment_sizes");;
252;
253 if (attr && ::mlir::failed(setFromAttr(prop.operandSegmentSizes, attr, emitError)))
254 return ::mlir::failure();
255 }
256 return ::mlir::success();
257}
258
259::mlir::Attribute NewPodOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
260 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
261 ::mlir::Builder odsBuilder{ctx};
262
263 {
264 const auto &propStorage = prop.initializedRecords;
265 if (propStorage)
266 attrs.push_back(odsBuilder.getNamedAttr("initializedRecords",
267 propStorage));
268 }
269
270 {
271 const auto &propStorage = prop.mapOpGroupSizes;
272 if (propStorage)
273 attrs.push_back(odsBuilder.getNamedAttr("mapOpGroupSizes",
274 propStorage));
275 }
276
277 {
278 const auto &propStorage = prop.numDimsPerMap;
279 if (propStorage)
280 attrs.push_back(odsBuilder.getNamedAttr("numDimsPerMap",
281 propStorage));
282 }
283
284 {
285 const auto &propStorage = prop.operandSegmentSizes;
286 auto attr = [&]() -> ::mlir::Attribute {
287 return ::mlir::DenseI32ArrayAttr::get(ctx, propStorage);
288 }();
289 attrs.push_back(odsBuilder.getNamedAttr("operandSegmentSizes", attr));
290 }
291
292 if (!attrs.empty())
293 return odsBuilder.getDictionaryAttr(attrs);
294 return {};
295}
296
297llvm::hash_code NewPodOp::computePropertiesHash(const Properties &prop) {
298 auto hash_operandSegmentSizes = [] (const auto &propStorage) -> llvm::hash_code {
299 return ::llvm::hash_combine_range(std::begin(propStorage), std::end(propStorage));;
300 };
301 return llvm::hash_combine(
302 llvm::hash_value(prop.initializedRecords.getAsOpaquePointer()),
303 llvm::hash_value(prop.mapOpGroupSizes.getAsOpaquePointer()),
304 llvm::hash_value(prop.numDimsPerMap.getAsOpaquePointer()),
305 hash_operandSegmentSizes(prop.operandSegmentSizes));
306}
307
308std::optional<mlir::Attribute> NewPodOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
309 if (name == "initializedRecords")
310 return prop.initializedRecords;
311
312 if (name == "mapOpGroupSizes")
313 return prop.mapOpGroupSizes;
314
315 if (name == "numDimsPerMap")
316 return prop.numDimsPerMap;
317 if (name == "operand_segment_sizes" || name == "operandSegmentSizes") return [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.operandSegmentSizes); }();
318 return std::nullopt;
319}
320
321void NewPodOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
322 if (name == "initializedRecords") {
323 prop.initializedRecords = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.initializedRecords)>>(value);
324 return;
325 }
326
327 if (name == "mapOpGroupSizes") {
328 prop.mapOpGroupSizes = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.mapOpGroupSizes)>>(value);
329 return;
330 }
331
332 if (name == "numDimsPerMap") {
333 prop.numDimsPerMap = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.numDimsPerMap)>>(value);
334 return;
335 }
336 if (name == "operand_segment_sizes" || name == "operandSegmentSizes") {
337 auto arrAttr = ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(value);
338 if (!arrAttr) return;
339 if (arrAttr.size() != sizeof(prop.operandSegmentSizes) / sizeof(int32_t))
340 return;
341 llvm::copy(arrAttr.asArrayRef(), prop.operandSegmentSizes.begin());
342 return;
343 }
344}
345
346void NewPodOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
347 if (prop.initializedRecords) attrs.append("initializedRecords", prop.initializedRecords);
348
349 if (prop.mapOpGroupSizes) attrs.append("mapOpGroupSizes", prop.mapOpGroupSizes);
350
351 if (prop.numDimsPerMap) attrs.append("numDimsPerMap", prop.numDimsPerMap);
352 attrs.append("operandSegmentSizes", [&]() -> ::mlir::Attribute { return ::mlir::DenseI32ArrayAttr::get(ctx, prop.operandSegmentSizes); }());
353}
354
355::llvm::LogicalResult NewPodOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
356 {
357 ::mlir::Attribute attr = attrs.get(getInitializedRecordsAttrName(opName));
358 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(attr, "initializedRecords", emitError)))
359 return ::mlir::failure();
360 }
361
362 {
363 ::mlir::Attribute attr = attrs.get(getMapOpGroupSizesAttrName(opName));
364 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "mapOpGroupSizes", emitError)))
365 return ::mlir::failure();
366 }
367
368 {
369 ::mlir::Attribute attr = attrs.get(getNumDimsPerMapAttrName(opName));
370 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(attr, "numDimsPerMap", emitError)))
371 return ::mlir::failure();
372 }
373 return ::mlir::success();
374}
375
376::llvm::LogicalResult NewPodOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
377 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
378 if (::mlir::failed(reader.readOptionalAttribute(prop.initializedRecords)))
379 return ::mlir::failure();
380
381 if (::mlir::failed(reader.readAttribute(prop.mapOpGroupSizes)))
382 return ::mlir::failure();
383
384 if (::mlir::failed(reader.readOptionalAttribute(prop.numDimsPerMap)))
385 return ::mlir::failure();
386
387 if (reader.getBytecodeVersion() < /*kNativePropertiesODSSegmentSize=*/6) {
388 auto &propStorage = prop.operandSegmentSizes;
389 ::mlir::DenseI32ArrayAttr attr;
390 if (::mlir::failed(reader.readAttribute(attr))) return ::mlir::failure();
391 if (attr.size() > static_cast<int64_t>(sizeof(propStorage) / sizeof(int32_t))) {
392 reader.emitError("size mismatch for operand/result_segment_size");
393 return ::mlir::failure();
394 }
395 ::llvm::copy(::llvm::ArrayRef<int32_t>(attr), propStorage.begin());
396 }
397
398 {
399 auto &propStorage = prop.operandSegmentSizes;
400 auto readProp = [&]() {
401
402 if (reader.getBytecodeVersion() >= /*kNativePropertiesODSSegmentSize=*/6)
403 return reader.readSparseArray(::llvm::MutableArrayRef(propStorage));
404;
405 return ::mlir::success();
406 };
407 if (::mlir::failed(readProp()))
408 return ::mlir::failure();
409 }
410 return ::mlir::success();
411}
412
413void NewPodOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
414 auto &prop = getProperties(); (void)prop;
415
416 writer.writeOptionalAttribute(prop.initializedRecords);
417 writer.writeAttribute(prop.mapOpGroupSizes);
418
419 writer.writeOptionalAttribute(prop.numDimsPerMap);
420
421if (writer.getBytecodeVersion() < /*kNativePropertiesODSSegmentSize=*/6) {
422 auto &propStorage = prop.operandSegmentSizes;
423 writer.writeAttribute(::mlir::DenseI32ArrayAttr::get(this->getContext(), propStorage));
424}
425
426 {
427 auto &propStorage = prop.operandSegmentSizes;
428
429 if (writer.getBytecodeVersion() >= /*kNativePropertiesODSSegmentSize=*/6)
430 writer.writeSparseArray(::llvm::ArrayRef(propStorage));
431;
432 }
433}
434
436 auto attr = getInitializedRecordsAttr();
437 return attr;
438}
439
440::llvm::ArrayRef<int32_t> NewPodOp::getNumDimsPerMap() {
441 auto attr = getNumDimsPerMapAttr();
442 return attr;
443}
444
445::llvm::ArrayRef<int32_t> NewPodOp::getMapOpGroupSizes() {
446 auto attr = getMapOpGroupSizesAttr();
447 return attr;
448}
449
450void NewPodOp::setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue) {
451 getProperties().numDimsPerMap = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
452}
453
454void NewPodOp::setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue) {
455 getProperties().mapOpGroupSizes = ::mlir::Builder((*this)->getContext()).getDenseI32ArrayAttr(attrValue);
456}
457
458void NewPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::InitializedRecords initialValues) {
459 auto resultType = ::llzk::pod::PodType::fromInitialValues(odsBuilder.getContext(), initialValues);
460 build(odsBuilder, odsState, resultType, initialValues);
461
462}
463
464void NewPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::PodType resultType, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::llzk::pod::InitializedRecords initialValues) {
465 build(odsBuilder, odsState, resultType, mapOperands,
466 odsBuilder.getDenseI32ArrayAttr(numDimsPerMap), initialValues);
467
468}
469
470void NewPodOp::populateDefaultProperties(::mlir::OperationName opName, Properties &properties) {
471 ::mlir::Builder odsBuilder(opName.getContext());
472 if (!properties.initializedRecords)
473 properties.initializedRecords = odsBuilder.getStrArrayAttr({});
474 if (!properties.numDimsPerMap)
475 properties.numDimsPerMap = odsBuilder.getDenseI32ArrayAttr({});
476}
477
478::llvm::LogicalResult NewPodOp::verifyInvariantsImpl() {
479 auto tblgen_initializedRecords = getProperties().initializedRecords; (void)tblgen_initializedRecords;
480 auto tblgen_mapOpGroupSizes = getProperties().mapOpGroupSizes; (void)tblgen_mapOpGroupSizes;
481 if (!tblgen_mapOpGroupSizes) return emitOpError("requires attribute 'mapOpGroupSizes'");
482 auto tblgen_numDimsPerMap = getProperties().numDimsPerMap; (void)tblgen_numDimsPerMap;
483
484 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops1(*this, tblgen_initializedRecords, "initializedRecords")))
485 return ::mlir::failure();
486
487 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_numDimsPerMap, "numDimsPerMap")))
488 return ::mlir::failure();
489
490 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops2(*this, tblgen_mapOpGroupSizes, "mapOpGroupSizes")))
491 return ::mlir::failure();
492 {
493 unsigned index = 0; (void)index;
494 auto valueGroup0 = getODSOperands(0);
495
496 for (auto v : valueGroup0) {
497 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops1(*this, v.getType(), "operand", index++)))
498 return ::mlir::failure();
499 }
500 auto valueGroup1 = getODSOperands(1);
501 if (::mlir::failed(::mlir::OpTrait::impl::verifyValueSizeAttr(*this, "mapOpGroupSizes", "mapOperands", valueGroup1.size())))
502 return ::mlir::failure();
503
504 for (auto v : valueGroup1) {
505 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops2(*this, v.getType(), "operand", index++)))
506 return ::mlir::failure();
507 }
508 }
509 {
510 unsigned index = 0; (void)index;
511 auto valueGroup0 = getODSResults(0);
512
513 for (auto v : valueGroup0) {
514 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "result", index++)))
515 return ::mlir::failure();
516 }
517 }
518 return ::mlir::success();
519}
520
521::llvm::LogicalResult NewPodOp::verifyInvariants() {
522 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
523 return ::mlir::success();
524 return ::mlir::failure();
525}
526
527void NewPodOp::getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects) {
528 effects.emplace_back(::mlir::MemoryEffects::Allocate::get(), 0, false, ::llzk::DiscardableAllocationResource::get());
529}
530
531} // namespace pod
532} // namespace llzk
533MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::pod::NewPodOp)
534
535namespace llzk {
536namespace pod {
537
538//===----------------------------------------------------------------------===//
539// ::llzk::pod::ReadPodOp definitions
540//===----------------------------------------------------------------------===//
541
542namespace detail {
543ReadPodOpGenericAdaptorBase::ReadPodOpGenericAdaptorBase(ReadPodOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
544
546 auto attr = getRecordNameAttr();
547 return attr.getValue();
548}
549
550} // namespace detail
552
553::llvm::LogicalResult ReadPodOpAdaptor::verify(::mlir::Location loc) {
554 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
555 if (!tblgen_record_name) return emitError(loc, "'pod.read' op ""requires attribute 'record_name'");
556
557 if (tblgen_record_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_record_name))))
558 return emitError(loc, "'pod.read' op ""attribute 'record_name' failed to satisfy constraint: string attribute");
559 return ::mlir::success();
560}
561
562::llvm::LogicalResult ReadPodOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
563 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
564 if (!dict) {
565 emitError() << "expected DictionaryAttr to set properties";
566 return ::mlir::failure();
567 }
568
569 {
570 auto &propStorage = prop.record_name;
571 auto attr = dict.get("record_name");
572 if (attr) {
573 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
574 if (convertedAttr) {
575 propStorage = convertedAttr;
576 } else {
577 emitError() << "Invalid attribute `record_name` in property conversion: " << attr;
578 return ::mlir::failure();
579 }
580 }
581 }
582 return ::mlir::success();
583}
584
585::mlir::Attribute ReadPodOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
586 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
587 ::mlir::Builder odsBuilder{ctx};
588
589 {
590 const auto &propStorage = prop.record_name;
591 if (propStorage)
592 attrs.push_back(odsBuilder.getNamedAttr("record_name",
593 propStorage));
594 }
595
596 if (!attrs.empty())
597 return odsBuilder.getDictionaryAttr(attrs);
598 return {};
599}
600
601llvm::hash_code ReadPodOp::computePropertiesHash(const Properties &prop) {
602 return llvm::hash_combine(
603 llvm::hash_value(prop.record_name.getAsOpaquePointer()));
604}
605
606std::optional<mlir::Attribute> ReadPodOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
607 if (name == "record_name")
608 return prop.record_name;
609 return std::nullopt;
610}
611
612void ReadPodOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
613 if (name == "record_name") {
614 prop.record_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.record_name)>>(value);
615 return;
616 }
617}
618
619void ReadPodOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
620 if (prop.record_name) attrs.append("record_name", prop.record_name);
621}
622
623::llvm::LogicalResult ReadPodOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
624 {
625 ::mlir::Attribute attr = attrs.get(getRecordNameAttrName(opName));
626 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "record_name", emitError)))
627 return ::mlir::failure();
628 }
629 return ::mlir::success();
630}
631
632::llvm::StringRef ReadPodOp::getRecordName() {
633 auto attr = getRecordNameAttr();
634 return attr.getValue();
635}
636
637void ReadPodOp::setRecordName(::llvm::StringRef attrValue) {
638 getProperties().record_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
639}
640
641void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::mlir::StringAttr record_name) {
642 odsState.addOperands(pod_ref);
643 odsState.getOrAddProperties<Properties>().record_name = record_name;
644 odsState.addTypes(result);
645}
646
647void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::StringAttr record_name) {
648 odsState.addOperands(pod_ref);
649 odsState.getOrAddProperties<Properties>().record_name = record_name;
650 assert(resultTypes.size() == 1u && "mismatched number of results");
651 odsState.addTypes(resultTypes);
652}
653
654void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::llvm::StringRef record_name) {
655 odsState.addOperands(pod_ref);
656 odsState.getOrAddProperties<Properties>().record_name = odsBuilder.getStringAttr(record_name);
657 odsState.addTypes(result);
658}
659
660void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::llvm::StringRef record_name) {
661 odsState.addOperands(pod_ref);
662 odsState.getOrAddProperties<Properties>().record_name = odsBuilder.getStringAttr(record_name);
663 assert(resultTypes.size() == 1u && "mismatched number of results");
664 odsState.addTypes(resultTypes);
665}
666
667void ReadPodOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
668 assert(operands.size() == 1u && "mismatched number of parameters");
669 odsState.addOperands(operands);
670 odsState.addAttributes(attributes);
671 assert(resultTypes.size() == 1u && "mismatched number of return types");
672 odsState.addTypes(resultTypes);
673
674 if (!attributes.empty()) {
675 ::mlir::OpaqueProperties properties =
676 &odsState.getOrAddProperties<ReadPodOp::Properties>();
677 std::optional<::mlir::RegisteredOperationName> info =
678 odsState.name.getRegisteredInfo();
679 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
680 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
681 ::llvm::report_fatal_error("Property conversion failed.");
682 }
683}
684
685::llvm::LogicalResult ReadPodOp::verifyInvariantsImpl() {
686 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
687 if (!tblgen_record_name) return emitOpError("requires attribute 'record_name'");
688
689 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_record_name, "record_name")))
690 return ::mlir::failure();
691 {
692 unsigned index = 0; (void)index;
693 auto valueGroup0 = getODSOperands(0);
694
695 for (auto v : valueGroup0) {
696 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
697 return ::mlir::failure();
698 }
699 }
700 {
701 unsigned index = 0; (void)index;
702 auto valueGroup0 = getODSResults(0);
703
704 for (auto v : valueGroup0) {
705 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "result", index++)))
706 return ::mlir::failure();
707 }
708 }
709 return ::mlir::success();
710}
711
712::llvm::LogicalResult ReadPodOp::verifyInvariants() {
713 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
714 return ::mlir::success();
715 return ::mlir::failure();
716}
717
718::mlir::ParseResult ReadPodOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
719 ::mlir::OpAsmParser::UnresolvedOperand pod_refRawOperand{};
720 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> pod_refOperands(&pod_refRawOperand, 1); ::llvm::SMLoc pod_refOperandsLoc;
721 (void)pod_refOperandsLoc;
722 ::mlir::StringAttr record_nameAttr;
723 ::mlir::Type pod_refRawType{};
724 ::llvm::ArrayRef<::mlir::Type> pod_refTypes(&pod_refRawType, 1);
725 ::mlir::Type resultRawType{};
726 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
727
728 pod_refOperandsLoc = parser.getCurrentLocation();
729 if (parser.parseOperand(pod_refRawOperand))
730 return ::mlir::failure();
731 if (parser.parseLSquare())
732 return ::mlir::failure();
733 {
734 auto odsResult = parseRecordName(parser, record_nameAttr);
735 if (odsResult) return ::mlir::failure();
736 result.getOrAddProperties<ReadPodOp::Properties>().record_name = record_nameAttr;
737 }
738 if (parser.parseRSquare())
739 return ::mlir::failure();
740 if (parser.parseColon())
741 return ::mlir::failure();
742
743 {
745 if (parser.parseCustomTypeWithFallback(type))
746 return ::mlir::failure();
747 pod_refRawType = type;
748 }
749 if (parser.parseComma())
750 return ::mlir::failure();
751
752 {
753 ::mlir::Type type;
754 if (parser.parseCustomTypeWithFallback(type))
755 return ::mlir::failure();
756 resultRawType = type;
757 }
758 {
759 auto loc = parser.getCurrentLocation();(void)loc;
760 if (parser.parseOptionalAttrDict(result.attributes))
761 return ::mlir::failure();
762 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
763 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
764 })))
765 return ::mlir::failure();
766 }
767 result.addTypes(resultTypes);
768 if (parser.resolveOperands(pod_refOperands, pod_refTypes, pod_refOperandsLoc, result.operands))
769 return ::mlir::failure();
770 return ::mlir::success();
771}
772
773void ReadPodOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
774 _odsPrinter << ' ';
775 _odsPrinter << getPodRef();
776 _odsPrinter << "[";
777 printRecordName(_odsPrinter, *this, getRecordNameAttr());
778 _odsPrinter << "]";
779 _odsPrinter << ' ' << ":";
780 _odsPrinter << ' ';
781 {
782 auto type = getPodRef().getType();
783 if (auto validType = ::llvm::dyn_cast<::llzk::pod::PodType>(type))
784 _odsPrinter.printStrippedAttrOrType(validType);
785 else
786 _odsPrinter << type;
787 }
788 _odsPrinter << ",";
789 _odsPrinter << ' ';
790 {
791 auto type = getResult().getType();
792 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
793 _odsPrinter.printStrippedAttrOrType(validType);
794 else
795 _odsPrinter << type;
796 }
797 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
798 elidedAttrs.push_back("record_name");
799 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
800}
801
803bool ReadPodOp::canRewire(const ::mlir::DestructurableMemorySlot &slot,
804 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
805 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
806 const ::mlir::DataLayout &dataLayout) {
807 return ::llvm::cast<PodAccessOpInterface>(getOperation())
808 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
809}
810
812::mlir::DeletionKind ReadPodOp::rewire(const ::mlir::DestructurableMemorySlot &slot,
813 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
814 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
815 return ::llvm::cast<PodAccessOpInterface>(getOperation())
816 .rewire(slot, subslots, builder, dataLayout);
817}
818
820bool ReadPodOp::loadsFrom(const ::mlir::MemorySlot &slot) {
821 return getPodRef() == slot.ptr;
822}
823
825bool ReadPodOp::storesTo(const ::mlir::MemorySlot &slot) {
826 return false;
827}
828
830::mlir::Value ReadPodOp::getStored(const ::mlir::MemorySlot &, ::mlir::OpBuilder &,
831 ::mlir::Value, const ::mlir::DataLayout &) {
832 llvm_unreachable("getStored() should not be called on ReadPodOp");
833}
834
837 const ::mlir::MemorySlot &slot,
838 const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &blockingUses,
839 ::llvm::SmallVectorImpl<::mlir::OpOperand *> & /*newBlockingUses*/,
840 const ::mlir::DataLayout & /*datalayout*/) {
841 if (blockingUses.size() != 1) {
842 return false;
843 }
844 ::mlir::Value blockingUse = (*blockingUses.begin())->get();
845 return blockingUse == slot.ptr && getPodRef() == slot.ptr &&
846 getResult().getType() == slot.elemType;
847}
848
850::mlir::DeletionKind ReadPodOp::removeBlockingUses(
851 const ::mlir::MemorySlot &, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &,
852 ::mlir::OpBuilder &, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &) {
853 getResult().replaceAllUsesWith(reachingDefinition);
854 return ::mlir::DeletionKind::Delete;
855}
856
859 return true;
860}
861
864 return getPodRef() == ptr;
865}
866
869 return false;
870}
871
873bool ReadPodOp::canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &) {
874 return false;
875}
876} // namespace pod
877} // namespace llzk
878MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::pod::ReadPodOp)
879
880namespace llzk {
881namespace pod {
882
883//===----------------------------------------------------------------------===//
884// ::llzk::pod::WritePodOp definitions
885//===----------------------------------------------------------------------===//
886
887namespace detail {
888WritePodOpGenericAdaptorBase::WritePodOpGenericAdaptorBase(WritePodOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
889
891 auto attr = getRecordNameAttr();
892 return attr.getValue();
893}
894
895} // namespace detail
897
898::llvm::LogicalResult WritePodOpAdaptor::verify(::mlir::Location loc) {
899 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
900 if (!tblgen_record_name) return emitError(loc, "'pod.write' op ""requires attribute 'record_name'");
901
902 if (tblgen_record_name && !((::llvm::isa<::mlir::StringAttr>(tblgen_record_name))))
903 return emitError(loc, "'pod.write' op ""attribute 'record_name' failed to satisfy constraint: string attribute");
904 return ::mlir::success();
905}
906
907::llvm::LogicalResult WritePodOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
908 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
909 if (!dict) {
910 emitError() << "expected DictionaryAttr to set properties";
911 return ::mlir::failure();
912 }
913
914 {
915 auto &propStorage = prop.record_name;
916 auto attr = dict.get("record_name");
917 if (attr) {
918 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
919 if (convertedAttr) {
920 propStorage = convertedAttr;
921 } else {
922 emitError() << "Invalid attribute `record_name` in property conversion: " << attr;
923 return ::mlir::failure();
924 }
925 }
926 }
927 return ::mlir::success();
928}
929
930::mlir::Attribute WritePodOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
931 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
932 ::mlir::Builder odsBuilder{ctx};
933
934 {
935 const auto &propStorage = prop.record_name;
936 if (propStorage)
937 attrs.push_back(odsBuilder.getNamedAttr("record_name",
938 propStorage));
939 }
940
941 if (!attrs.empty())
942 return odsBuilder.getDictionaryAttr(attrs);
943 return {};
944}
945
946llvm::hash_code WritePodOp::computePropertiesHash(const Properties &prop) {
947 return llvm::hash_combine(
948 llvm::hash_value(prop.record_name.getAsOpaquePointer()));
949}
950
951std::optional<mlir::Attribute> WritePodOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
952 if (name == "record_name")
953 return prop.record_name;
954 return std::nullopt;
955}
956
957void WritePodOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
958 if (name == "record_name") {
959 prop.record_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.record_name)>>(value);
960 return;
961 }
962}
963
964void WritePodOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
965 if (prop.record_name) attrs.append("record_name", prop.record_name);
966}
967
968::llvm::LogicalResult WritePodOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
969 {
970 ::mlir::Attribute attr = attrs.get(getRecordNameAttrName(opName));
971 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "record_name", emitError)))
972 return ::mlir::failure();
973 }
974 return ::mlir::success();
975}
976
977::llvm::StringRef WritePodOp::getRecordName() {
978 auto attr = getRecordNameAttr();
979 return attr.getValue();
980}
981
982void WritePodOp::setRecordName(::llvm::StringRef attrValue) {
983 getProperties().record_name = ::mlir::Builder((*this)->getContext()).getStringAttr(attrValue);
984}
985
986void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::StringAttr record_name, ::mlir::Value value) {
987 odsState.addOperands(pod_ref);
988 odsState.addOperands(value);
989 odsState.getOrAddProperties<Properties>().record_name = record_name;
990}
991
992void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::StringAttr record_name, ::mlir::Value value) {
993 odsState.addOperands(pod_ref);
994 odsState.addOperands(value);
995 odsState.getOrAddProperties<Properties>().record_name = record_name;
996 assert(resultTypes.size() == 0u && "mismatched number of results");
997 odsState.addTypes(resultTypes);
998}
999
1000void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value) {
1001 odsState.addOperands(pod_ref);
1002 odsState.addOperands(value);
1003 odsState.getOrAddProperties<Properties>().record_name = odsBuilder.getStringAttr(record_name);
1004}
1005
1006void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value) {
1007 odsState.addOperands(pod_ref);
1008 odsState.addOperands(value);
1009 odsState.getOrAddProperties<Properties>().record_name = odsBuilder.getStringAttr(record_name);
1010 assert(resultTypes.size() == 0u && "mismatched number of results");
1011 odsState.addTypes(resultTypes);
1012}
1013
1014void WritePodOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1015 assert(operands.size() == 2u && "mismatched number of parameters");
1016 odsState.addOperands(operands);
1017 odsState.addAttributes(attributes);
1018 assert(resultTypes.size() == 0u && "mismatched number of return types");
1019 odsState.addTypes(resultTypes);
1020
1021 if (!attributes.empty()) {
1022 ::mlir::OpaqueProperties properties =
1023 &odsState.getOrAddProperties<WritePodOp::Properties>();
1024 std::optional<::mlir::RegisteredOperationName> info =
1025 odsState.name.getRegisteredInfo();
1026 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1027 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1028 ::llvm::report_fatal_error("Property conversion failed.");
1029 }
1030}
1031
1032::llvm::LogicalResult WritePodOp::verifyInvariantsImpl() {
1033 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
1034 if (!tblgen_record_name) return emitOpError("requires attribute 'record_name'");
1035
1036 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_record_name, "record_name")))
1037 return ::mlir::failure();
1038 {
1039 unsigned index = 0; (void)index;
1040 auto valueGroup0 = getODSOperands(0);
1041
1042 for (auto v : valueGroup0) {
1043 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
1044 return ::mlir::failure();
1045 }
1046 auto valueGroup1 = getODSOperands(1);
1047
1048 for (auto v : valueGroup1) {
1049 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "operand", index++)))
1050 return ::mlir::failure();
1051 }
1052 }
1053 return ::mlir::success();
1054}
1055
1056::llvm::LogicalResult WritePodOp::verifyInvariants() {
1057 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1058 return ::mlir::success();
1059 return ::mlir::failure();
1060}
1061
1062::mlir::ParseResult WritePodOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1063 ::mlir::OpAsmParser::UnresolvedOperand pod_refRawOperand{};
1064 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> pod_refOperands(&pod_refRawOperand, 1); ::llvm::SMLoc pod_refOperandsLoc;
1065 (void)pod_refOperandsLoc;
1066 ::mlir::StringAttr record_nameAttr;
1067 ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
1068 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
1069 (void)valueOperandsLoc;
1070 ::mlir::Type pod_refRawType{};
1071 ::llvm::ArrayRef<::mlir::Type> pod_refTypes(&pod_refRawType, 1);
1072 ::mlir::Type valueRawType{};
1073 ::llvm::ArrayRef<::mlir::Type> valueTypes(&valueRawType, 1);
1074
1075 pod_refOperandsLoc = parser.getCurrentLocation();
1076 if (parser.parseOperand(pod_refRawOperand))
1077 return ::mlir::failure();
1078 if (parser.parseLSquare())
1079 return ::mlir::failure();
1080 {
1081 auto odsResult = parseRecordName(parser, record_nameAttr);
1082 if (odsResult) return ::mlir::failure();
1083 result.getOrAddProperties<WritePodOp::Properties>().record_name = record_nameAttr;
1084 }
1085 if (parser.parseRSquare())
1086 return ::mlir::failure();
1087 if (parser.parseEqual())
1088 return ::mlir::failure();
1089
1090 valueOperandsLoc = parser.getCurrentLocation();
1091 if (parser.parseOperand(valueRawOperand))
1092 return ::mlir::failure();
1093 if (parser.parseColon())
1094 return ::mlir::failure();
1095
1096 {
1098 if (parser.parseCustomTypeWithFallback(type))
1099 return ::mlir::failure();
1100 pod_refRawType = type;
1101 }
1102 if (parser.parseComma())
1103 return ::mlir::failure();
1104
1105 {
1106 ::mlir::Type type;
1107 if (parser.parseCustomTypeWithFallback(type))
1108 return ::mlir::failure();
1109 valueRawType = type;
1110 }
1111 {
1112 auto loc = parser.getCurrentLocation();(void)loc;
1113 if (parser.parseOptionalAttrDict(result.attributes))
1114 return ::mlir::failure();
1115 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1116 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1117 })))
1118 return ::mlir::failure();
1119 }
1120 if (parser.resolveOperands(pod_refOperands, pod_refTypes, pod_refOperandsLoc, result.operands))
1121 return ::mlir::failure();
1122 if (parser.resolveOperands(valueOperands, valueTypes, valueOperandsLoc, result.operands))
1123 return ::mlir::failure();
1124 return ::mlir::success();
1125}
1126
1127void WritePodOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1128 _odsPrinter << ' ';
1129 _odsPrinter << getPodRef();
1130 _odsPrinter << "[";
1131 printRecordName(_odsPrinter, *this, getRecordNameAttr());
1132 _odsPrinter << "]";
1133 _odsPrinter << ' ' << "=";
1134 _odsPrinter << ' ';
1135 _odsPrinter << getValue();
1136 _odsPrinter << ' ' << ":";
1137 _odsPrinter << ' ';
1138 {
1139 auto type = getPodRef().getType();
1140 if (auto validType = ::llvm::dyn_cast<::llzk::pod::PodType>(type))
1141 _odsPrinter.printStrippedAttrOrType(validType);
1142 else
1143 _odsPrinter << type;
1144 }
1145 _odsPrinter << ",";
1146 _odsPrinter << ' ';
1147 {
1148 auto type = getValue().getType();
1149 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1150 _odsPrinter.printStrippedAttrOrType(validType);
1151 else
1152 _odsPrinter << type;
1153 }
1154 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1155 elidedAttrs.push_back("record_name");
1156 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1157}
1158
1160bool WritePodOp::canRewire(const ::mlir::DestructurableMemorySlot &slot,
1161 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
1162 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
1163 const ::mlir::DataLayout &dataLayout) {
1164 return ::llvm::cast<PodAccessOpInterface>(getOperation())
1165 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
1166}
1167
1169::mlir::DeletionKind WritePodOp::rewire(const ::mlir::DestructurableMemorySlot &slot,
1170 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
1171 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
1172 return ::llvm::cast<PodAccessOpInterface>(getOperation())
1173 .rewire(slot, subslots, builder, dataLayout);
1174}
1175
1177bool WritePodOp::loadsFrom(const ::mlir::MemorySlot &slot) {
1178 return false;
1179}
1180
1182bool WritePodOp::storesTo(const ::mlir::MemorySlot &slot) {
1183 return getPodRef() == slot.ptr;
1184}
1185
1187::mlir::Value WritePodOp::getStored(const ::mlir::MemorySlot &, ::mlir::OpBuilder &,
1188 ::mlir::Value, const ::mlir::DataLayout &) {
1189 return getValue();
1190}
1191
1194 const ::mlir::MemorySlot &slot,
1195 const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &blockingUses,
1196 ::llvm::SmallVectorImpl<::mlir::OpOperand *> & /*newBlockingUses*/,
1197 const ::mlir::DataLayout & /*datalayout*/) {
1198 if (blockingUses.size() != 1) {
1199 return false;
1200 }
1201 ::mlir::Value blockingUse = (*blockingUses.begin())->get();
1202 return blockingUse == slot.ptr && getPodRef() == slot.ptr &&
1203 getValue() != slot.ptr && getValue().getType() == slot.elemType;
1204}
1205
1208 const ::mlir::MemorySlot &, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &,
1209 ::mlir::OpBuilder &, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &) {
1210 ;
1211 return ::mlir::DeletionKind::Delete;
1212}
1213
1216 return false;
1217}
1218
1221 return false;
1222}
1223
1226 return getPodRef() == ptr && getValue() != ptr;
1227}
1228
1230bool WritePodOp::canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &) {
1231 return getPodRef() == ptr && getValue() != ptr;
1232}
1233} // namespace pod
1234} // namespace llzk
1235MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::pod::WritePodOp)
1236
1237
1238#endif // GET_OP_CLASSES
1239
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:159
NewPodOpAdaptor(NewPodOp op)
Definition Ops.cpp.inc:157
NewPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:129
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:521
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:197
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:297
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:527
::mlir::ArrayAttr getInitializedRecordsAttr()
Definition Ops.h.inc:270
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:376
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:478
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:308
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:259
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:470
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:321
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:454
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::pod::InitializedRecords initialValues={})
Definition Ops.cpp.inc:458
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:440
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:346
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:176
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:275
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:251
::mlir::StringAttr getInitializedRecordsAttrName()
Definition Ops.h.inc:194
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:445
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:231
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:202
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:280
::mlir::MutableOperandRange getInitialValuesMutable()
Definition Ops.cpp.inc:185
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:450
FoldAdaptor::Properties Properties
Definition Ops.h.inc:188
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:355
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:191
::llvm::LogicalResult verify()
Definition Ops.cpp:291
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:413
::mlir::ArrayAttr getInitializedRecords()
Definition Ops.cpp.inc:435
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:210
static PodType fromInitialValues(::mlir::MLIRContext *ctx, InitializedRecords init)
Creates a new type from a set of initialized records.
Definition Types.cpp:42
ReadPodOpAdaptor(ReadPodOp op)
Definition Ops.cpp.inc:551
ReadPodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:405
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:553
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:712
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:585
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:632
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:619
::mlir::TypedValue<::mlir::Type > getResult()
Definition Ops.h.inc:499
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:474
bool canUsesBeRemoved(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand * > &blockingUses, ::llvm::SmallVectorImpl<::mlir::OpOperand * > &newBlockingUses, const ::mlir::DataLayout &datalayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:836
::mlir::DeletionKind removeBlockingUses(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl< mlir::OpOperand * > &blockingUses, ::mlir::OpBuilder &builder, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &dataLayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:850
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:825
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:858
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:685
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:718
::llvm::LogicalResult verify()
Definition Ops.cpp:538
FoldAdaptor::Properties Properties
Definition Ops.h.inc:452
::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout)
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp.inc:830
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:562
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:480
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:773
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:601
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::mlir::StringAttr record_name)
Definition Ops.cpp.inc:641
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:612
bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:873
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:606
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:493
::mlir::StringAttr getRecordNameAttr()
Definition Ops.h.inc:512
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:458
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:820
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.
Definition Ops.cpp.inc:803
bool storesToDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:868
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:637
bool loadsFromDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:863
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:623
::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.
Definition Ops.cpp.inc:812
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:633
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:898
WritePodOpAdaptor(WritePodOp op)
Definition Ops.cpp.inc:896
bool canUsesBeRemoved(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand * > &blockingUses, ::llvm::SmallVectorImpl<::mlir::OpOperand * > &newBlockingUses, const ::mlir::DataLayout &datalayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1193
::mlir::Value getStored(const ::mlir::MemorySlot &slot, ::mlir::OpBuilder &builder, ::mlir::Value reachingDef, const ::mlir::DataLayout &dataLayout)
Required by PromotableAllocationOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1187
::llvm::LogicalResult verify()
Definition Ops.cpp:571
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:946
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::StringAttr record_name, ::mlir::Value value)
Definition Ops.cpp.inc:986
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1127
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1056
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1062
bool loadsFromDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:1220
::mlir::StringAttr getRecordNameAttr()
Definition Ops.h.inc:749
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:968
::mlir::TypedValue<::mlir::Type > getValue()
Definition Ops.h.inc:716
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:982
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:712
FoldAdaptor::Properties Properties
Definition Ops.h.inc:684
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:951
::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.
Definition Ops.cpp.inc:1169
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1215
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.
Definition Ops.cpp.inc:1160
::mlir::DeletionKind removeBlockingUses(const ::mlir::MemorySlot &slot, const ::llvm::SmallPtrSetImpl< mlir::OpOperand * > &blockingUses, ::mlir::OpBuilder &builder, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &dataLayout)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1207
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:706
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1032
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1182
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:977
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:964
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:907
bool canEraseAsDeadStoreTo(::mlir::Value ptr, const ::mlir::DataLayout &dataLayout)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:1230
bool storesToDiscardableAllocation(::mlir::Value ptr)
Required by DiscardableAllocationAccessorOpInterface / unused allocation cleanup.
Definition Ops.cpp.inc:1225
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1177
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:957
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:690
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:930
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:116
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:122
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:151
NewPodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:97
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:146
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:141
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:93
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:370
ReadPodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:374
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:598
WritePodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:602
mlir::ArrayRef< RecordValue > InitializedRecords
Definition Types.h:25
void printRecordName(AsmPrinter &printer, Operation *, StringAttr name)
Definition Ops.cpp:604
ParseResult parseRecordName(AsmParser &parser, StringAttr &name)
Definition Ops.cpp:595
bool isValidType(Type type)