LLZK 2.1.1
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::FlatSymbolRefAttr>(attr))))
100 return emitError() << "attribute '" << attrName
101 << "' failed to satisfy constraint: flat symbol reference 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}
529
530} // namespace pod
531} // namespace llzk
532MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::pod::NewPodOp)
533
534namespace llzk {
535namespace pod {
536
537//===----------------------------------------------------------------------===//
538// ::llzk::pod::ReadPodOp definitions
539//===----------------------------------------------------------------------===//
540
541namespace detail {
542ReadPodOpGenericAdaptorBase::ReadPodOpGenericAdaptorBase(ReadPodOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
543
545 auto attr = getRecordNameAttr();
546 return attr.getValue();
547}
548
549} // namespace detail
551
552::llvm::LogicalResult ReadPodOpAdaptor::verify(::mlir::Location loc) {
553 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
554 if (!tblgen_record_name) return emitError(loc, "'pod.read' op ""requires attribute 'record_name'");
555
556 if (tblgen_record_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_record_name))))
557 return emitError(loc, "'pod.read' op ""attribute 'record_name' failed to satisfy constraint: flat symbol reference attribute");
558 return ::mlir::success();
559}
560
561::llvm::LogicalResult ReadPodOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
562 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
563 if (!dict) {
564 emitError() << "expected DictionaryAttr to set properties";
565 return ::mlir::failure();
566 }
567
568 {
569 auto &propStorage = prop.record_name;
570 auto attr = dict.get("record_name");
571 if (attr) {
572 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
573 if (convertedAttr) {
574 propStorage = convertedAttr;
575 } else {
576 emitError() << "Invalid attribute `record_name` in property conversion: " << attr;
577 return ::mlir::failure();
578 }
579 }
580 }
581 return ::mlir::success();
582}
583
584::mlir::Attribute ReadPodOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
585 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
586 ::mlir::Builder odsBuilder{ctx};
587
588 {
589 const auto &propStorage = prop.record_name;
590 if (propStorage)
591 attrs.push_back(odsBuilder.getNamedAttr("record_name",
592 propStorage));
593 }
594
595 if (!attrs.empty())
596 return odsBuilder.getDictionaryAttr(attrs);
597 return {};
598}
599
600llvm::hash_code ReadPodOp::computePropertiesHash(const Properties &prop) {
601 return llvm::hash_combine(
602 llvm::hash_value(prop.record_name.getAsOpaquePointer()));
603}
604
605std::optional<mlir::Attribute> ReadPodOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
606 if (name == "record_name")
607 return prop.record_name;
608 return std::nullopt;
609}
610
611void ReadPodOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
612 if (name == "record_name") {
613 prop.record_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.record_name)>>(value);
614 return;
615 }
616}
617
618void ReadPodOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
619 if (prop.record_name) attrs.append("record_name", prop.record_name);
620}
621
622::llvm::LogicalResult ReadPodOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
623 {
624 ::mlir::Attribute attr = attrs.get(getRecordNameAttrName(opName));
625 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "record_name", emitError)))
626 return ::mlir::failure();
627 }
628 return ::mlir::success();
629}
630
631::llvm::LogicalResult ReadPodOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
632 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
633 if (::mlir::failed(reader.readAttribute(prop.record_name)))
634 return ::mlir::failure();
635 return ::mlir::success();
636}
637
638void ReadPodOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
639 auto &prop = getProperties(); (void)prop;
640 writer.writeAttribute(prop.record_name);
641}
642
643::llvm::StringRef ReadPodOp::getRecordName() {
644 auto attr = getRecordNameAttr();
645 return attr.getValue();
646}
647
648void ReadPodOp::setRecordName(::llvm::StringRef attrValue) {
649 getProperties().record_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
650}
651
652void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name) {
653 odsState.addOperands(pod_ref);
654 odsState.getOrAddProperties<Properties>().record_name = record_name;
655 odsState.addTypes(result);
656}
657
658void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name) {
659 odsState.addOperands(pod_ref);
660 odsState.getOrAddProperties<Properties>().record_name = record_name;
661 assert(resultTypes.size() == 1u && "mismatched number of results");
662 odsState.addTypes(resultTypes);
663}
664
665void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::llvm::StringRef record_name) {
666 odsState.addOperands(pod_ref);
667 odsState.getOrAddProperties<Properties>().record_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), record_name);
668 odsState.addTypes(result);
669}
670
671void ReadPodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::llvm::StringRef record_name) {
672 odsState.addOperands(pod_ref);
673 odsState.getOrAddProperties<Properties>().record_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), record_name);
674 assert(resultTypes.size() == 1u && "mismatched number of results");
675 odsState.addTypes(resultTypes);
676}
677
678void ReadPodOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
679 assert(operands.size() == 1u && "mismatched number of parameters");
680 odsState.addOperands(operands);
681 odsState.addAttributes(attributes);
682 assert(resultTypes.size() == 1u && "mismatched number of return types");
683 odsState.addTypes(resultTypes);
684
685 if (!attributes.empty()) {
686 ::mlir::OpaqueProperties properties =
687 &odsState.getOrAddProperties<ReadPodOp::Properties>();
688 std::optional<::mlir::RegisteredOperationName> info =
689 odsState.name.getRegisteredInfo();
690 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
691 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
692 ::llvm::report_fatal_error("Property conversion failed.");
693 }
694}
695
696::llvm::LogicalResult ReadPodOp::verifyInvariantsImpl() {
697 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
698 if (!tblgen_record_name) return emitOpError("requires attribute 'record_name'");
699
700 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_record_name, "record_name")))
701 return ::mlir::failure();
702 {
703 unsigned index = 0; (void)index;
704 auto valueGroup0 = getODSOperands(0);
705
706 for (auto v : valueGroup0) {
707 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
708 return ::mlir::failure();
709 }
710 }
711 {
712 unsigned index = 0; (void)index;
713 auto valueGroup0 = getODSResults(0);
714
715 for (auto v : valueGroup0) {
716 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "result", index++)))
717 return ::mlir::failure();
718 }
719 }
720 return ::mlir::success();
721}
722
723::llvm::LogicalResult ReadPodOp::verifyInvariants() {
724 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
725 return ::mlir::success();
726 return ::mlir::failure();
727}
728
729::mlir::ParseResult ReadPodOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
730 ::mlir::OpAsmParser::UnresolvedOperand pod_refRawOperand{};
731 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> pod_refOperands(&pod_refRawOperand, 1); ::llvm::SMLoc pod_refOperandsLoc;
732 (void)pod_refOperandsLoc;
733 ::mlir::FlatSymbolRefAttr record_nameAttr;
734 ::mlir::Type pod_refRawType{};
735 ::llvm::ArrayRef<::mlir::Type> pod_refTypes(&pod_refRawType, 1);
736 ::mlir::Type resultRawType{};
737 ::llvm::ArrayRef<::mlir::Type> resultTypes(&resultRawType, 1);
738
739 pod_refOperandsLoc = parser.getCurrentLocation();
740 if (parser.parseOperand(pod_refRawOperand))
741 return ::mlir::failure();
742 if (parser.parseLSquare())
743 return ::mlir::failure();
744 {
745 auto odsResult = parseRecordName(parser, record_nameAttr);
746 if (odsResult) return ::mlir::failure();
747 result.getOrAddProperties<ReadPodOp::Properties>().record_name = record_nameAttr;
748 }
749 if (parser.parseRSquare())
750 return ::mlir::failure();
751 if (parser.parseColon())
752 return ::mlir::failure();
753
754 {
756 if (parser.parseCustomTypeWithFallback(type))
757 return ::mlir::failure();
758 pod_refRawType = type;
759 }
760 if (parser.parseComma())
761 return ::mlir::failure();
762
763 {
764 ::mlir::Type type;
765 if (parser.parseCustomTypeWithFallback(type))
766 return ::mlir::failure();
767 resultRawType = type;
768 }
769 {
770 auto loc = parser.getCurrentLocation();(void)loc;
771 if (parser.parseOptionalAttrDict(result.attributes))
772 return ::mlir::failure();
773 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
774 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
775 })))
776 return ::mlir::failure();
777 }
778 result.addTypes(resultTypes);
779 if (parser.resolveOperands(pod_refOperands, pod_refTypes, pod_refOperandsLoc, result.operands))
780 return ::mlir::failure();
781 return ::mlir::success();
782}
783
784void ReadPodOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
785 _odsPrinter << ' ';
786 _odsPrinter << getPodRef();
787 _odsPrinter << "[";
788 printRecordName(_odsPrinter, *this, getRecordNameAttr());
789 _odsPrinter << "]";
790 _odsPrinter << ' ' << ":";
791 _odsPrinter << ' ';
792 {
793 auto type = getPodRef().getType();
794 if (auto validType = ::llvm::dyn_cast<::llzk::pod::PodType>(type))
795 _odsPrinter.printStrippedAttrOrType(validType);
796 else
797 _odsPrinter << type;
798 }
799 _odsPrinter << ",";
800 _odsPrinter << ' ';
801 {
802 auto type = getResult().getType();
803 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
804 _odsPrinter.printStrippedAttrOrType(validType);
805 else
806 _odsPrinter << type;
807 }
808 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
809 elidedAttrs.push_back("record_name");
810 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
811}
812
814bool ReadPodOp::canRewire(const ::mlir::DestructurableMemorySlot &slot,
815 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
816 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
817 const ::mlir::DataLayout &dataLayout) {
818 return ::llvm::cast<PodAccessOpInterface>(getOperation())
819 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
820}
821
823::mlir::DeletionKind ReadPodOp::rewire(const ::mlir::DestructurableMemorySlot &slot,
824 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
825 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
826 return ::llvm::cast<PodAccessOpInterface>(getOperation())
827 .rewire(slot, subslots, builder, dataLayout);
828}
829
831bool ReadPodOp::loadsFrom(const ::mlir::MemorySlot &slot) {
832 return getPodRef() == slot.ptr;
833}
834
836bool ReadPodOp::storesTo(const ::mlir::MemorySlot &slot) {
837 return false;
838}
839
841::mlir::Value ReadPodOp::getStored(const ::mlir::MemorySlot &, ::mlir::OpBuilder &,
842 ::mlir::Value, const ::mlir::DataLayout &) {
843 llvm_unreachable("getStored() should not be called on ReadPodOp");
844}
845
848 const ::mlir::MemorySlot &slot,
849 const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &blockingUses,
850 ::llvm::SmallVectorImpl<::mlir::OpOperand *> & /*newBlockingUses*/,
851 const ::mlir::DataLayout & /*datalayout*/) {
852 if (blockingUses.size() != 1) {
853 return false;
854 }
855 ::mlir::Value blockingUse = (*blockingUses.begin())->get();
856 return blockingUse == slot.ptr && getPodRef() == slot.ptr &&
857 getResult().getType() == slot.elemType;
858}
859
861::mlir::DeletionKind ReadPodOp::removeBlockingUses(
862 const ::mlir::MemorySlot &, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &,
863 ::mlir::OpBuilder &, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &) {
864 getResult().replaceAllUsesWith(reachingDefinition);
865 return ::mlir::DeletionKind::Delete;
866}
867
870 return true;
871}
872} // namespace pod
873} // namespace llzk
874MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::pod::ReadPodOp)
875
876namespace llzk {
877namespace pod {
878
879//===----------------------------------------------------------------------===//
880// ::llzk::pod::WritePodOp definitions
881//===----------------------------------------------------------------------===//
882
883namespace detail {
884WritePodOpGenericAdaptorBase::WritePodOpGenericAdaptorBase(WritePodOp op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), properties(op.getProperties()), odsRegions(op->getRegions()) {}
885
887 auto attr = getRecordNameAttr();
888 return attr.getValue();
889}
890
891} // namespace detail
893
894::llvm::LogicalResult WritePodOpAdaptor::verify(::mlir::Location loc) {
895 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
896 if (!tblgen_record_name) return emitError(loc, "'pod.write' op ""requires attribute 'record_name'");
897
898 if (tblgen_record_name && !((::llvm::isa<::mlir::FlatSymbolRefAttr>(tblgen_record_name))))
899 return emitError(loc, "'pod.write' op ""attribute 'record_name' failed to satisfy constraint: flat symbol reference attribute");
900 return ::mlir::success();
901}
902
903::llvm::LogicalResult WritePodOp::setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
904 ::mlir::DictionaryAttr dict = ::llvm::dyn_cast<::mlir::DictionaryAttr>(attr);
905 if (!dict) {
906 emitError() << "expected DictionaryAttr to set properties";
907 return ::mlir::failure();
908 }
909
910 {
911 auto &propStorage = prop.record_name;
912 auto attr = dict.get("record_name");
913 if (attr) {
914 auto convertedAttr = ::llvm::dyn_cast<std::remove_reference_t<decltype(propStorage)>>(attr);
915 if (convertedAttr) {
916 propStorage = convertedAttr;
917 } else {
918 emitError() << "Invalid attribute `record_name` in property conversion: " << attr;
919 return ::mlir::failure();
920 }
921 }
922 }
923 return ::mlir::success();
924}
925
926::mlir::Attribute WritePodOp::getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop) {
927 ::mlir::SmallVector<::mlir::NamedAttribute> attrs;
928 ::mlir::Builder odsBuilder{ctx};
929
930 {
931 const auto &propStorage = prop.record_name;
932 if (propStorage)
933 attrs.push_back(odsBuilder.getNamedAttr("record_name",
934 propStorage));
935 }
936
937 if (!attrs.empty())
938 return odsBuilder.getDictionaryAttr(attrs);
939 return {};
940}
941
942llvm::hash_code WritePodOp::computePropertiesHash(const Properties &prop) {
943 return llvm::hash_combine(
944 llvm::hash_value(prop.record_name.getAsOpaquePointer()));
945}
946
947std::optional<mlir::Attribute> WritePodOp::getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name) {
948 if (name == "record_name")
949 return prop.record_name;
950 return std::nullopt;
951}
952
953void WritePodOp::setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value) {
954 if (name == "record_name") {
955 prop.record_name = ::llvm::dyn_cast_or_null<std::remove_reference_t<decltype(prop.record_name)>>(value);
956 return;
957 }
958}
959
960void WritePodOp::populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs) {
961 if (prop.record_name) attrs.append("record_name", prop.record_name);
962}
963
964::llvm::LogicalResult WritePodOp::verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError) {
965 {
966 ::mlir::Attribute attr = attrs.get(getRecordNameAttrName(opName));
967 if (attr && ::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(attr, "record_name", emitError)))
968 return ::mlir::failure();
969 }
970 return ::mlir::success();
971}
972
973::llvm::LogicalResult WritePodOp::readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state) {
974 auto &prop = state.getOrAddProperties<Properties>(); (void)prop;
975 if (::mlir::failed(reader.readAttribute(prop.record_name)))
976 return ::mlir::failure();
977 return ::mlir::success();
978}
979
980void WritePodOp::writeProperties(::mlir::DialectBytecodeWriter &writer) {
981 auto &prop = getProperties(); (void)prop;
982 writer.writeAttribute(prop.record_name);
983}
984
985::llvm::StringRef WritePodOp::getRecordName() {
986 auto attr = getRecordNameAttr();
987 return attr.getValue();
988}
989
990void WritePodOp::setRecordName(::llvm::StringRef attrValue) {
991 getProperties().record_name = ::mlir::SymbolRefAttr::get(::mlir::Builder((*this)->getContext()).getContext(), attrValue);
992}
993
994void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name, ::mlir::Value value) {
995 odsState.addOperands(pod_ref);
996 odsState.addOperands(value);
997 odsState.getOrAddProperties<Properties>().record_name = record_name;
998}
999
1000void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name, ::mlir::Value value) {
1001 odsState.addOperands(pod_ref);
1002 odsState.addOperands(value);
1003 odsState.getOrAddProperties<Properties>().record_name = record_name;
1004 assert(resultTypes.size() == 0u && "mismatched number of results");
1005 odsState.addTypes(resultTypes);
1006}
1007
1008void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value) {
1009 odsState.addOperands(pod_ref);
1010 odsState.addOperands(value);
1011 odsState.getOrAddProperties<Properties>().record_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), record_name);
1012}
1013
1014void WritePodOp::build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value pod_ref, ::llvm::StringRef record_name, ::mlir::Value value) {
1015 odsState.addOperands(pod_ref);
1016 odsState.addOperands(value);
1017 odsState.getOrAddProperties<Properties>().record_name = ::mlir::SymbolRefAttr::get(odsBuilder.getContext(), record_name);
1018 assert(resultTypes.size() == 0u && "mismatched number of results");
1019 odsState.addTypes(resultTypes);
1020}
1021
1022void WritePodOp::build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes) {
1023 assert(operands.size() == 2u && "mismatched number of parameters");
1024 odsState.addOperands(operands);
1025 odsState.addAttributes(attributes);
1026 assert(resultTypes.size() == 0u && "mismatched number of return types");
1027 odsState.addTypes(resultTypes);
1028
1029 if (!attributes.empty()) {
1030 ::mlir::OpaqueProperties properties =
1031 &odsState.getOrAddProperties<WritePodOp::Properties>();
1032 std::optional<::mlir::RegisteredOperationName> info =
1033 odsState.name.getRegisteredInfo();
1034 if (failed(info->setOpPropertiesFromAttribute(odsState.name, properties,
1035 odsState.attributes.getDictionary(odsState.getContext()), nullptr)))
1036 ::llvm::report_fatal_error("Property conversion failed.");
1037 }
1038}
1039
1040::llvm::LogicalResult WritePodOp::verifyInvariantsImpl() {
1041 auto tblgen_record_name = getProperties().record_name; (void)tblgen_record_name;
1042 if (!tblgen_record_name) return emitOpError("requires attribute 'record_name'");
1043
1044 if (::mlir::failed(__mlir_ods_local_attr_constraint_Ops3(*this, tblgen_record_name, "record_name")))
1045 return ::mlir::failure();
1046 {
1047 unsigned index = 0; (void)index;
1048 auto valueGroup0 = getODSOperands(0);
1049
1050 for (auto v : valueGroup0) {
1051 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops3(*this, v.getType(), "operand", index++)))
1052 return ::mlir::failure();
1053 }
1054 auto valueGroup1 = getODSOperands(1);
1055
1056 for (auto v : valueGroup1) {
1057 if (::mlir::failed(__mlir_ods_local_type_constraint_Ops4(*this, v.getType(), "operand", index++)))
1058 return ::mlir::failure();
1059 }
1060 }
1061 return ::mlir::success();
1062}
1063
1064::llvm::LogicalResult WritePodOp::verifyInvariants() {
1065 if(::mlir::succeeded(verifyInvariantsImpl()) && ::mlir::succeeded(verify()))
1066 return ::mlir::success();
1067 return ::mlir::failure();
1068}
1069
1070::mlir::ParseResult WritePodOp::parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result) {
1071 ::mlir::OpAsmParser::UnresolvedOperand pod_refRawOperand{};
1072 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> pod_refOperands(&pod_refRawOperand, 1); ::llvm::SMLoc pod_refOperandsLoc;
1073 (void)pod_refOperandsLoc;
1074 ::mlir::FlatSymbolRefAttr record_nameAttr;
1075 ::mlir::OpAsmParser::UnresolvedOperand valueRawOperand{};
1076 ::llvm::ArrayRef<::mlir::OpAsmParser::UnresolvedOperand> valueOperands(&valueRawOperand, 1); ::llvm::SMLoc valueOperandsLoc;
1077 (void)valueOperandsLoc;
1078 ::mlir::Type pod_refRawType{};
1079 ::llvm::ArrayRef<::mlir::Type> pod_refTypes(&pod_refRawType, 1);
1080 ::mlir::Type valueRawType{};
1081 ::llvm::ArrayRef<::mlir::Type> valueTypes(&valueRawType, 1);
1082
1083 pod_refOperandsLoc = parser.getCurrentLocation();
1084 if (parser.parseOperand(pod_refRawOperand))
1085 return ::mlir::failure();
1086 if (parser.parseLSquare())
1087 return ::mlir::failure();
1088 {
1089 auto odsResult = parseRecordName(parser, record_nameAttr);
1090 if (odsResult) return ::mlir::failure();
1091 result.getOrAddProperties<WritePodOp::Properties>().record_name = record_nameAttr;
1092 }
1093 if (parser.parseRSquare())
1094 return ::mlir::failure();
1095 if (parser.parseEqual())
1096 return ::mlir::failure();
1097
1098 valueOperandsLoc = parser.getCurrentLocation();
1099 if (parser.parseOperand(valueRawOperand))
1100 return ::mlir::failure();
1101 if (parser.parseColon())
1102 return ::mlir::failure();
1103
1104 {
1106 if (parser.parseCustomTypeWithFallback(type))
1107 return ::mlir::failure();
1108 pod_refRawType = type;
1109 }
1110 if (parser.parseComma())
1111 return ::mlir::failure();
1112
1113 {
1114 ::mlir::Type type;
1115 if (parser.parseCustomTypeWithFallback(type))
1116 return ::mlir::failure();
1117 valueRawType = type;
1118 }
1119 {
1120 auto loc = parser.getCurrentLocation();(void)loc;
1121 if (parser.parseOptionalAttrDict(result.attributes))
1122 return ::mlir::failure();
1123 if (failed(verifyInherentAttrs(result.name, result.attributes, [&]() {
1124 return parser.emitError(loc) << "'" << result.name.getStringRef() << "' op ";
1125 })))
1126 return ::mlir::failure();
1127 }
1128 if (parser.resolveOperands(pod_refOperands, pod_refTypes, pod_refOperandsLoc, result.operands))
1129 return ::mlir::failure();
1130 if (parser.resolveOperands(valueOperands, valueTypes, valueOperandsLoc, result.operands))
1131 return ::mlir::failure();
1132 return ::mlir::success();
1133}
1134
1135void WritePodOp::print(::mlir::OpAsmPrinter &_odsPrinter) {
1136 _odsPrinter << ' ';
1137 _odsPrinter << getPodRef();
1138 _odsPrinter << "[";
1139 printRecordName(_odsPrinter, *this, getRecordNameAttr());
1140 _odsPrinter << "]";
1141 _odsPrinter << ' ' << "=";
1142 _odsPrinter << ' ';
1143 _odsPrinter << getValue();
1144 _odsPrinter << ' ' << ":";
1145 _odsPrinter << ' ';
1146 {
1147 auto type = getPodRef().getType();
1148 if (auto validType = ::llvm::dyn_cast<::llzk::pod::PodType>(type))
1149 _odsPrinter.printStrippedAttrOrType(validType);
1150 else
1151 _odsPrinter << type;
1152 }
1153 _odsPrinter << ",";
1154 _odsPrinter << ' ';
1155 {
1156 auto type = getValue().getType();
1157 if (auto validType = ::llvm::dyn_cast<::mlir::Type>(type))
1158 _odsPrinter.printStrippedAttrOrType(validType);
1159 else
1160 _odsPrinter << type;
1161 }
1162 ::llvm::SmallVector<::llvm::StringRef, 2> elidedAttrs;
1163 elidedAttrs.push_back("record_name");
1164 _odsPrinter.printOptionalAttrDict((*this)->getAttrs(), elidedAttrs);
1165}
1166
1168bool WritePodOp::canRewire(const ::mlir::DestructurableMemorySlot &slot,
1169 ::llvm::SmallPtrSetImpl<::mlir::Attribute> &usedIndices,
1170 ::mlir::SmallVectorImpl<::mlir::MemorySlot> &mustBeSafelyUsed,
1171 const ::mlir::DataLayout &dataLayout) {
1172 return ::llvm::cast<PodAccessOpInterface>(getOperation())
1173 .canRewire(slot, usedIndices, mustBeSafelyUsed, dataLayout);
1174}
1175
1177::mlir::DeletionKind WritePodOp::rewire(const ::mlir::DestructurableMemorySlot &slot,
1178 ::llvm::DenseMap<::mlir::Attribute, ::mlir::MemorySlot> &subslots,
1179 ::mlir::OpBuilder &builder, const ::mlir::DataLayout &dataLayout) {
1180 return ::llvm::cast<PodAccessOpInterface>(getOperation())
1181 .rewire(slot, subslots, builder, dataLayout);
1182}
1183
1185bool WritePodOp::loadsFrom(const ::mlir::MemorySlot &slot) {
1186 return false;
1187}
1188
1190bool WritePodOp::storesTo(const ::mlir::MemorySlot &slot) {
1191 return getPodRef() == slot.ptr;
1192}
1193
1195::mlir::Value WritePodOp::getStored(const ::mlir::MemorySlot &, ::mlir::OpBuilder &,
1196 ::mlir::Value, const ::mlir::DataLayout &) {
1197 return getValue();
1198}
1199
1202 const ::mlir::MemorySlot &slot,
1203 const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &blockingUses,
1204 ::llvm::SmallVectorImpl<::mlir::OpOperand *> & /*newBlockingUses*/,
1205 const ::mlir::DataLayout & /*datalayout*/) {
1206 if (blockingUses.size() != 1) {
1207 return false;
1208 }
1209 ::mlir::Value blockingUse = (*blockingUses.begin())->get();
1210 return blockingUse == slot.ptr && getPodRef() == slot.ptr &&
1211 getValue() != slot.ptr && getValue().getType() == slot.elemType;
1212}
1213
1216 const ::mlir::MemorySlot &, const ::llvm::SmallPtrSetImpl<::mlir::OpOperand *> &,
1217 ::mlir::OpBuilder &, ::mlir::Value reachingDefinition, const ::mlir::DataLayout &) {
1218 ;
1219 return ::mlir::DeletionKind::Delete;
1220}
1221
1224 return false;
1225}
1226} // namespace pod
1227} // namespace llzk
1228MLIR_DEFINE_EXPLICIT_TYPE_ID(::llzk::pod::WritePodOp)
1229
1230
1231#endif // GET_OP_CLASSES
1232
::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:290
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:550
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:552
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:723
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:584
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:643
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:618
::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:847
::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:861
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:512
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:836
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:869
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:696
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:638
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:729
::llvm::LogicalResult verify()
Definition Ops.cpp:501
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:841
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:561
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:480
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:784
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:600
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:611
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:605
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:493
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:631
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name)
Definition Ops.cpp.inc:652
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:458
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:831
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:814
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:648
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:622
::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:823
WritePodOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:630
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:894
WritePodOpAdaptor(WritePodOp op)
Definition Ops.cpp.inc:892
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:1201
::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:1195
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:746
::llvm::LogicalResult verify()
Definition Ops.cpp:525
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:942
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1135
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:973
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1064
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1070
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:964
::mlir::TypedValue<::mlir::Type > getValue()
Definition Ops.h.inc:713
void setRecordName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:990
::mlir::TypedValue<::llzk::pod::PodType > getPodRef()
Definition Ops.h.inc:709
FoldAdaptor::Properties Properties
Definition Ops.h.inc:681
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:947
::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:1177
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1223
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:1168
::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:1215
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:703
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1040
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:980
bool storesTo(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1190
::llvm::StringRef getRecordName()
Definition Ops.cpp.inc:985
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:960
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:903
bool loadsFrom(const ::mlir::MemorySlot &slot)
Required by PromotableMemOpInterface / mem2reg pass.
Definition Ops.cpp.inc:1185
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:953
::mlir::StringAttr getRecordNameAttrName()
Definition Ops.h.inc:687
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value pod_ref, ::mlir::FlatSymbolRefAttr record_name, ::mlir::Value value)
Definition Ops.cpp.inc:994
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:926
::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
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:392
::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
::mlir::FlatSymbolRefAttr getRecordNameAttr()
Definition Ops.h.inc:617
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:595
WritePodOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:599
mlir::ArrayRef< RecordValue > InitializedRecords
Definition Types.h:25
ParseResult parseRecordName(AsmParser &parser, FlatSymbolRefAttr &name)
Definition Ops.cpp:549
void printRecordName(AsmPrinter &printer, Operation *, FlatSymbolRefAttr name)
Definition Ops.cpp:553
bool isValidType(Type type)