LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk {
11namespace component {
12class CreateStructOp;
13} // namespace component
14} // namespace llzk
15namespace llzk {
16namespace component {
17class FieldDefOp;
18} // namespace component
19} // namespace llzk
20namespace llzk {
21namespace component {
22class FieldReadOp;
23} // namespace component
24} // namespace llzk
25namespace llzk {
26namespace component {
27class FieldWriteOp;
28} // namespace component
29} // namespace llzk
30namespace llzk {
31namespace component {
32class StructDefOp;
33} // namespace component
34} // namespace llzk
35#ifdef GET_OP_CLASSES
36#undef GET_OP_CLASSES
37
38namespace llzk {
39namespace component {
40
41//===----------------------------------------------------------------------===//
42// ::llzk::component::CreateStructOp declarations
43//===----------------------------------------------------------------------===//
44
45namespace detail {
47public:
48protected:
49 ::mlir::DictionaryAttr odsAttrs;
50 ::std::optional<::mlir::OperationName> odsOpName;
51 ::mlir::RegionRange odsRegions;
52public:
53 CreateStructOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
54 odsOpName.emplace("struct.new", odsAttrs.getContext());
55 }
56
57 CreateStructOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
58
59 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
60 return {index, 1};
61 }
62
63 ::mlir::DictionaryAttr getAttributes() {
64 return odsAttrs;
65 }
66
67};
68} // namespace detail
69template <typename RangeT>
71 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
73public:
74 CreateStructOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
75
76 CreateStructOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : CreateStructOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
77
78 CreateStructOpGenericAdaptor(RangeT values, const CreateStructOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
79
80 template <typename LateInst = CreateStructOp, typename = std::enable_if_t<std::is_same_v<LateInst, CreateStructOp>>>
81 CreateStructOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
82
83 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
84 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
85 }
86
87 RangeT getODSOperands(unsigned index) {
88 auto valueRange = getODSOperandIndexAndLength(index);
89 return {std::next(odsOperands.begin(), valueRange.first),
90 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
91 }
92
93 RangeT getOperands() {
94 return odsOperands;
95 }
96
97private:
98 RangeT odsOperands;
99};
100class CreateStructOpAdaptor : public CreateStructOpGenericAdaptor<::mlir::ValueRange> {
101public:
104
105 ::llvm::LogicalResult verify(::mlir::Location loc);
106};
107class CreateStructOp : public ::mlir::Op<CreateStructOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::llzk::component::StructType>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::llzk::function::WitnessGen, ::mlir::OpTrait::OpInvariants, ::mlir::OpAsmOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
108public:
109 using Op::Op;
110 using Op::print;
112 template <typename RangeT>
115 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
116 return {};
117 }
118
119 static constexpr ::llvm::StringLiteral getOperationName() {
120 return ::llvm::StringLiteral("struct.new");
121 }
122
123 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
124 return {index, 1};
125 }
126
127 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
128 auto valueRange = getODSOperandIndexAndLength(index);
129 return {std::next(getOperation()->operand_begin(), valueRange.first),
130 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
131 }
132
133 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
134 return {index, 1};
135 }
136
137 ::mlir::Operation::result_range getODSResults(unsigned index) {
138 auto valueRange = getODSResultIndexAndLength(index);
139 return {std::next(getOperation()->result_begin(), valueRange.first),
140 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
141 }
142
143 ::mlir::TypedValue<::llzk::component::StructType> getResult() {
144 return ::llvm::cast<::mlir::TypedValue<::llzk::component::StructType>>(*getODSResults(0).begin());
145 }
146
147 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result);
148 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes);
149 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
150 ::llvm::LogicalResult verifyInvariantsImpl();
151 ::llvm::LogicalResult verifyInvariants();
152 void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn);
153 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
154 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
155 void print(::mlir::OpAsmPrinter &_odsPrinter);
156public:
157};
158} // namespace component
159} // namespace llzk
160MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::CreateStructOp)
161
162namespace llzk {
163namespace component {
164
165//===----------------------------------------------------------------------===//
166// ::llzk::component::FieldDefOp declarations
167//===----------------------------------------------------------------------===//
168
169namespace detail {
171public:
172 struct Properties {
173 using columnTy = ::mlir::UnitAttr;
175
176 auto getColumn() {
177 auto &propStorage = this->column;
178 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(propStorage);
179 }
180 void setColumn(const ::mlir::UnitAttr &propValue) {
181 this->column = propValue;
182 }
183 using sym_nameTy = ::mlir::StringAttr;
185
186 auto getSymName() {
187 auto &propStorage = this->sym_name;
188 return ::llvm::cast<::mlir::StringAttr>(propStorage);
189 }
190 void setSymName(const ::mlir::StringAttr &propValue) {
191 this->sym_name = propValue;
192 }
193 using typeTy = ::mlir::TypeAttr;
195
196 auto getType() {
197 auto &propStorage = this->type;
198 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
199 }
200 void setType(const ::mlir::TypeAttr &propValue) {
201 this->type = propValue;
202 }
203 bool operator==(const Properties &rhs) const {
204 return
205 rhs.column == this->column &&
206 rhs.sym_name == this->sym_name &&
207 rhs.type == this->type &&
208 true;
209 }
210 bool operator!=(const Properties &rhs) const {
211 return !(*this == rhs);
212 }
213 };
214protected:
215 ::mlir::DictionaryAttr odsAttrs;
216 ::std::optional<::mlir::OperationName> odsOpName;
218 ::mlir::RegionRange odsRegions;
219public:
220 FieldDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
221 odsOpName.emplace("struct.field", odsAttrs.getContext());
222 }
223
225
226 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
227 return {index, 1};
228 }
229
231 return properties;
232 }
233
234 ::mlir::DictionaryAttr getAttributes() {
235 return odsAttrs;
236 }
237
238 ::mlir::StringAttr getSymNameAttr() {
239 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
240 return attr;
241 }
242
243 ::llvm::StringRef getSymName();
244 ::mlir::TypeAttr getTypeAttr() {
245 auto attr = ::llvm::cast<::mlir::TypeAttr>(getProperties().type);
246 return attr;
247 }
248
249 ::mlir::Type getType();
250 ::mlir::UnitAttr getColumnAttr();
251 bool getColumn();
252};
253} // namespace detail
254template <typename RangeT>
256 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
258public:
259 FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
260
261 FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FieldDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
262
263 FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FieldDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
264
265 FieldDefOpGenericAdaptor(RangeT values, const FieldDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
266
267 template <typename LateInst = FieldDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, FieldDefOp>>>
268 FieldDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
269
270 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
271 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
272 }
273
274 RangeT getODSOperands(unsigned index) {
275 auto valueRange = getODSOperandIndexAndLength(index);
276 return {std::next(odsOperands.begin(), valueRange.first),
277 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
278 }
279
280 RangeT getOperands() {
281 return odsOperands;
282 }
283
284private:
285 RangeT odsOperands;
286};
287class FieldDefOpAdaptor : public FieldDefOpGenericAdaptor<::mlir::ValueRange> {
288public:
291
292 ::llvm::LogicalResult verify(::mlir::Location loc);
293};
294class FieldDefOp : public ::mlir::Op<FieldDefOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::llzk::component::StructDefOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait, ::mlir::SymbolOpInterface::Trait> {
295public:
296 using Op::Op;
297 using Op::print;
299 template <typename RangeT>
303 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
304 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("column"), ::llvm::StringRef("sym_name"), ::llvm::StringRef("type")};
305 return ::llvm::ArrayRef(attrNames);
306 }
307
308 ::mlir::StringAttr getColumnAttrName() {
309 return getAttributeNameForIndex(0);
310 }
311
312 static ::mlir::StringAttr getColumnAttrName(::mlir::OperationName name) {
313 return getAttributeNameForIndex(name, 0);
314 }
315
316 ::mlir::StringAttr getSymNameAttrName() {
317 return getAttributeNameForIndex(1);
318 }
319
320 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
321 return getAttributeNameForIndex(name, 1);
322 }
323
324 ::mlir::StringAttr getTypeAttrName() {
325 return getAttributeNameForIndex(2);
326 }
327
328 static ::mlir::StringAttr getTypeAttrName(::mlir::OperationName name) {
329 return getAttributeNameForIndex(name, 2);
330 }
331
332 static constexpr ::llvm::StringLiteral getOperationName() {
333 return ::llvm::StringLiteral("struct.field");
334 }
335
336 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
337 return {index, 1};
338 }
339
340 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
341 auto valueRange = getODSOperandIndexAndLength(index);
342 return {std::next(getOperation()->operand_begin(), valueRange.first),
343 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
344 }
345
346 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
347 return {index, 1};
348 }
349
350 ::mlir::Operation::result_range getODSResults(unsigned index) {
351 auto valueRange = getODSResultIndexAndLength(index);
352 return {std::next(getOperation()->result_begin(), valueRange.first),
353 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
354 }
355
356 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
357 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
358 static llvm::hash_code computePropertiesHash(const Properties &prop);
359 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
360 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
361 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
362 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
363 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
364 void writeProperties(::mlir::DialectBytecodeWriter &writer);
365 ::mlir::StringAttr getSymNameAttr() {
366 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
367 }
368
369 ::llvm::StringRef getSymName();
370 ::mlir::TypeAttr getTypeAttr() {
371 return ::llvm::cast<::mlir::TypeAttr>(getProperties().type);
372 }
373
374 ::mlir::Type getType();
375 ::mlir::UnitAttr getColumnAttr() {
376 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().column);
377 }
378
379 bool getColumn();
380 void setSymNameAttr(::mlir::StringAttr attr) {
381 getProperties().sym_name = attr;
382 }
383
384 void setSymName(::llvm::StringRef attrValue);
385 void setTypeAttr(::mlir::TypeAttr attr) {
386 getProperties().type = attr;
387 }
388
389 void setType(::mlir::Type attrValue);
390 void setColumnAttr(::mlir::UnitAttr attr) {
391 getProperties().column = attr;
392 }
393
394 void setColumn(bool attrValue);
395 ::mlir::Attribute removeColumnAttr() {
396 auto &attr = getProperties().column;
397 attr = {};
398 return attr;
399 }
400
401 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type, bool isColumn = false);
402 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::Type type, bool isColumn = false);
403 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, bool isColumn = false);
404 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, bool isColumn = false);
405 ::llvm::LogicalResult verifyInvariantsImpl();
406 ::llvm::LogicalResult verifyInvariants();
407 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
408 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
409 void print(::mlir::OpAsmPrinter &_odsPrinter);
410private:
411 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
412 return getAttributeNameForIndex((*this)->getName(), index);
413 }
414
415 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
416 assert(index < 3 && "invalid attribute index");
417 assert(name.getStringRef() == getOperationName() && "invalid operation name");
418 assert(name.isRegistered() && "Operation isn't registered, missing a "
419 "dependent dialect loading?");
420 return name.getAttributeNames()[index];
421 }
422
423public:
424 inline bool hasPublicAttr() { return getOperation()->hasAttr(llzk::PublicAttr::name); }
425 void setPublicAttr(bool newValue = true);
426};
427} // namespace component
428} // namespace llzk
429MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::FieldDefOp)
430
431namespace llzk {
432namespace component {
433
434//===----------------------------------------------------------------------===//
435// ::llzk::component::FieldReadOp declarations
436//===----------------------------------------------------------------------===//
437
438namespace detail {
440public:
441 struct Properties {
442 using field_nameTy = ::mlir::FlatSymbolRefAttr;
444
446 auto &propStorage = this->field_name;
447 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
448 }
449 void setFieldName(const ::mlir::FlatSymbolRefAttr &propValue) {
450 this->field_name = propValue;
451 }
452 using mapOpGroupSizesTy = ::mlir::DenseI32ArrayAttr;
454
456 auto &propStorage = this->mapOpGroupSizes;
457 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
458 }
459 void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue) {
460 this->mapOpGroupSizes = propValue;
461 }
462 using numDimsPerMapTy = ::mlir::DenseI32ArrayAttr;
464
466 auto &propStorage = this->numDimsPerMap;
467 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
468 }
469 void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue) {
470 this->numDimsPerMap = propValue;
471 }
472 using tableOffsetTy = ::mlir::Attribute;
474
476 auto &propStorage = this->tableOffset;
477 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(propStorage);
478 }
479 void setTableOffset(const ::mlir::Attribute &propValue) {
480 this->tableOffset = propValue;
481 }
482 bool operator==(const Properties &rhs) const {
483 return
484 rhs.field_name == this->field_name &&
485 rhs.mapOpGroupSizes == this->mapOpGroupSizes &&
486 rhs.numDimsPerMap == this->numDimsPerMap &&
487 rhs.tableOffset == this->tableOffset &&
488 true;
489 }
490 bool operator!=(const Properties &rhs) const {
491 return !(*this == rhs);
492 }
493 };
494protected:
495 ::mlir::DictionaryAttr odsAttrs;
496 ::std::optional<::mlir::OperationName> odsOpName;
498 ::mlir::RegionRange odsRegions;
499public:
500 FieldReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
501 odsOpName.emplace("struct.readf", odsAttrs.getContext());
502 }
503
505
506 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
508 return properties;
509 }
510
511 ::mlir::DictionaryAttr getAttributes() {
512 return odsAttrs;
513 }
514
515 ::mlir::FlatSymbolRefAttr getFieldNameAttr() {
516 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().field_name);
517 return attr;
518 }
519
520 ::llvm::StringRef getFieldName();
521 ::mlir::Attribute getTableOffsetAttr() {
522 auto attr = ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().tableOffset);
523 return attr;
524 }
525
526 ::std::optional<::mlir::Attribute> getTableOffset();
527 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
528 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
529 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
530 auto attr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
531 return attr;
532 }
533
534 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
535};
536} // namespace detail
537template <typename RangeT>
539 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
541public:
542 FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
543
544 FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FieldReadOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
545
546 FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FieldReadOpGenericAdaptor(values, attrs, Properties{}, {}) {}
547
548 FieldReadOpGenericAdaptor(RangeT values, const FieldReadOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
549
550 template <typename LateInst = FieldReadOp, typename = std::enable_if_t<std::is_same_v<LateInst, FieldReadOp>>>
551 FieldReadOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
552
553 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
554 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
555 }
556
557 RangeT getODSOperands(unsigned index) {
558 auto valueRange = getODSOperandIndexAndLength(index);
559 return {std::next(odsOperands.begin(), valueRange.first),
560 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
561 }
562
563 ValueT getComponent() {
564 return (*getODSOperands(0).begin());
565 }
566
567 ::llvm::SmallVector<RangeT> getMapOperands() {
568 auto tblgenTmpOperands = getODSOperands(1);
569 auto sizes = getMapOpGroupSizes();
570
571 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
572 for (int i = 0, e = sizes.size(); i < e; ++i) {
573 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
574 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
575 }
576 return tblgenTmpOperandGroups;
577 }
578
579 RangeT getOperands() {
580 return odsOperands;
581 }
582
583private:
584 RangeT odsOperands;
585};
586class FieldReadOpAdaptor : public FieldReadOpGenericAdaptor<::mlir::ValueRange> {
587public:
590
591 ::llvm::LogicalResult verify(::mlir::Location loc);
592};
593class FieldReadOp : public ::mlir::Op<FieldReadOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::OneResult, ::mlir::OpTrait::OneTypedResult<::mlir::Type>::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::AtLeastNOperands<1>::Impl, ::llzk::VerifySizesForMultiAffineOps<1>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::llzk::component::FieldRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
594public:
595 using Op::Op;
596 using Op::print;
598 template <typename RangeT>
602 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
603 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("field_name"), ::llvm::StringRef("mapOpGroupSizes"), ::llvm::StringRef("numDimsPerMap"), ::llvm::StringRef("tableOffset")};
604 return ::llvm::ArrayRef(attrNames);
605 }
606
607 ::mlir::StringAttr getFieldNameAttrName() {
608 return getAttributeNameForIndex(0);
609 }
610
611 static ::mlir::StringAttr getFieldNameAttrName(::mlir::OperationName name) {
612 return getAttributeNameForIndex(name, 0);
613 }
614
615 ::mlir::StringAttr getMapOpGroupSizesAttrName() {
616 return getAttributeNameForIndex(1);
617 }
618
619 static ::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name) {
620 return getAttributeNameForIndex(name, 1);
621 }
622
623 ::mlir::StringAttr getNumDimsPerMapAttrName() {
624 return getAttributeNameForIndex(2);
625 }
626
627 static ::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name) {
628 return getAttributeNameForIndex(name, 2);
629 }
630
631 ::mlir::StringAttr getTableOffsetAttrName() {
632 return getAttributeNameForIndex(3);
633 }
634
635 static ::mlir::StringAttr getTableOffsetAttrName(::mlir::OperationName name) {
636 return getAttributeNameForIndex(name, 3);
637 }
638
639 static constexpr ::llvm::StringLiteral getOperationName() {
640 return ::llvm::StringLiteral("struct.readf");
641 }
642
643 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
644 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
645 auto valueRange = getODSOperandIndexAndLength(index);
646 return {std::next(getOperation()->operand_begin(), valueRange.first),
647 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
648 }
649
650 ::mlir::TypedValue<::llzk::component::StructType> getComponent() {
651 return ::llvm::cast<::mlir::TypedValue<::llzk::component::StructType>>(*getODSOperands(0).begin());
652 }
653
654 ::mlir::OperandRangeRange getMapOperands() {
655 return getODSOperands(1).split(getMapOpGroupSizesAttr());
656 }
657
658 ::mlir::OpOperand &getComponentMutable() {
659 auto range = getODSOperandIndexAndLength(0);
660 return getOperation()->getOpOperand(range.first);
661 }
662
663 ::mlir::MutableOperandRangeRange getMapOperandsMutable();
664 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
665 return {index, 1};
666 }
667
668 ::mlir::Operation::result_range getODSResults(unsigned index) {
669 auto valueRange = getODSResultIndexAndLength(index);
670 return {std::next(getOperation()->result_begin(), valueRange.first),
671 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
672 }
673
674 ::mlir::TypedValue<::mlir::Type> getVal() {
675 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
676 }
677
678 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
679 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
680 static llvm::hash_code computePropertiesHash(const Properties &prop);
681 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
682 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
683 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
684 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
685 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
686 void writeProperties(::mlir::DialectBytecodeWriter &writer);
687 ::mlir::FlatSymbolRefAttr getFieldNameAttr() {
688 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().field_name);
689 }
690
691 ::llvm::StringRef getFieldName();
692 ::mlir::Attribute getTableOffsetAttr() {
693 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().tableOffset);
694 }
695
696 ::std::optional<::mlir::Attribute> getTableOffset();
697 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr() {
698 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
699 }
700
701 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
702 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
703 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
704 }
705
706 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
707 void setFieldNameAttr(::mlir::FlatSymbolRefAttr attr) {
708 getProperties().field_name = attr;
709 }
710
711 void setFieldName(::llvm::StringRef attrValue);
712 void setTableOffsetAttr(::mlir::Attribute attr) {
713 getProperties().tableOffset = attr;
714 }
715
716 void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr) {
717 getProperties().numDimsPerMap = attr;
718 }
719
720 void setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue);
721 void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr) {
722 getProperties().mapOpGroupSizes = attr;
723 }
724
725 void setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue);
726 ::mlir::Attribute removeTableOffsetAttr() {
727 auto &attr = getProperties().tableOffset;
728 attr = {};
729 return attr;
730 }
731
732 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field);
733 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field, ::mlir::Attribute dist, ::mlir::ValueRange mapOperands, std::optional<int32_t> numDims);
734 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field, ::mlir::SymbolRefAttr dist);
735 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field, ::mlir::IntegerAttr dist);
736 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::ArrayRef<::mlir::NamedAttribute> attrs);
737 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
738 ::llvm::LogicalResult verifyInvariantsImpl();
739 ::llvm::LogicalResult verifyInvariants();
740 ::llvm::LogicalResult verify();
741 bool isRead();
742 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
743 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
744 void print(::mlir::OpAsmPrinter &_odsPrinter);
745private:
746 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
747 return getAttributeNameForIndex((*this)->getName(), index);
748 }
749
750 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
751 assert(index < 4 && "invalid attribute index");
752 assert(name.getStringRef() == getOperationName() && "invalid operation name");
753 assert(name.isRegistered() && "Operation isn't registered, missing a "
754 "dependent dialect loading?");
755 return name.getAttributeNames()[index];
756 }
757
758public:
760 inline ::mlir::FailureOr<SymbolLookupResult<FieldDefOp>> getFieldDefOp(::mlir::SymbolTableCollection &tables) {
761 return ::llvm::cast<FieldRefOpInterface>(getOperation()).getFieldDefOp(tables);
762 }
763};
764} // namespace component
765} // namespace llzk
766MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::FieldReadOp)
767
768namespace llzk {
769namespace component {
770
771//===----------------------------------------------------------------------===//
772// ::llzk::component::FieldWriteOp declarations
773//===----------------------------------------------------------------------===//
774
775namespace detail {
777public:
778 struct Properties {
779 using field_nameTy = ::mlir::FlatSymbolRefAttr;
781
783 auto &propStorage = this->field_name;
784 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
785 }
786 void setFieldName(const ::mlir::FlatSymbolRefAttr &propValue) {
787 this->field_name = propValue;
788 }
789 bool operator==(const Properties &rhs) const {
790 return
791 rhs.field_name == this->field_name &&
792 true;
793 }
794 bool operator!=(const Properties &rhs) const {
795 return !(*this == rhs);
796 }
797 };
798protected:
799 ::mlir::DictionaryAttr odsAttrs;
800 ::std::optional<::mlir::OperationName> odsOpName;
802 ::mlir::RegionRange odsRegions;
803public:
804 FieldWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
805 odsOpName.emplace("struct.writef", odsAttrs.getContext());
806 }
807
809
810 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
811 return {index, 1};
812 }
813
815 return properties;
816 }
817
818 ::mlir::DictionaryAttr getAttributes() {
819 return odsAttrs;
820 }
821
822 ::mlir::FlatSymbolRefAttr getFieldNameAttr() {
823 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().field_name);
824 return attr;
825 }
826
827 ::llvm::StringRef getFieldName();
828};
829} // namespace detail
830template <typename RangeT>
832 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
834public:
835 FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
836
837 FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FieldWriteOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
838
839 FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FieldWriteOpGenericAdaptor(values, attrs, Properties{}, {}) {}
840
841 FieldWriteOpGenericAdaptor(RangeT values, const FieldWriteOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
842
843 template <typename LateInst = FieldWriteOp, typename = std::enable_if_t<std::is_same_v<LateInst, FieldWriteOp>>>
844 FieldWriteOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
845
846 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
847 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
848 }
849
850 RangeT getODSOperands(unsigned index) {
851 auto valueRange = getODSOperandIndexAndLength(index);
852 return {std::next(odsOperands.begin(), valueRange.first),
853 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
854 }
855
856 ValueT getComponent() {
857 return (*getODSOperands(0).begin());
858 }
859
860 ValueT getVal() {
861 return (*getODSOperands(1).begin());
862 }
863
864 RangeT getOperands() {
865 return odsOperands;
866 }
867
868private:
869 RangeT odsOperands;
870};
871class FieldWriteOpAdaptor : public FieldWriteOpGenericAdaptor<::mlir::ValueRange> {
872public:
875
876 ::llvm::LogicalResult verify(::mlir::Location loc);
877};
878class FieldWriteOp : public ::mlir::Op<FieldWriteOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::llzk::function::WitnessGen, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::llzk::component::FieldRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
879public:
880 using Op::Op;
881 using Op::print;
883 template <typename RangeT>
887 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
888 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("field_name")};
889 return ::llvm::ArrayRef(attrNames);
890 }
891
892 ::mlir::StringAttr getFieldNameAttrName() {
893 return getAttributeNameForIndex(0);
894 }
895
896 static ::mlir::StringAttr getFieldNameAttrName(::mlir::OperationName name) {
897 return getAttributeNameForIndex(name, 0);
898 }
899
900 static constexpr ::llvm::StringLiteral getOperationName() {
901 return ::llvm::StringLiteral("struct.writef");
902 }
903
904 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
905 return {index, 1};
906 }
907
908 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
909 auto valueRange = getODSOperandIndexAndLength(index);
910 return {std::next(getOperation()->operand_begin(), valueRange.first),
911 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
912 }
913
914 ::mlir::TypedValue<::llzk::component::StructType> getComponent() {
915 return ::llvm::cast<::mlir::TypedValue<::llzk::component::StructType>>(*getODSOperands(0).begin());
916 }
917
918 ::mlir::TypedValue<::mlir::Type> getVal() {
919 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(1).begin());
920 }
921
922 ::mlir::OpOperand &getComponentMutable() {
923 auto range = getODSOperandIndexAndLength(0);
924 return getOperation()->getOpOperand(range.first);
925 }
926
927 ::mlir::OpOperand &getValMutable() {
928 auto range = getODSOperandIndexAndLength(1);
929 return getOperation()->getOpOperand(range.first);
930 }
931
932 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
933 return {index, 1};
934 }
935
936 ::mlir::Operation::result_range getODSResults(unsigned index) {
937 auto valueRange = getODSResultIndexAndLength(index);
938 return {std::next(getOperation()->result_begin(), valueRange.first),
939 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
940 }
941
942 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
943 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
944 static llvm::hash_code computePropertiesHash(const Properties &prop);
945 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
946 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
947 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
948 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
949 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
950 void writeProperties(::mlir::DialectBytecodeWriter &writer);
951 ::mlir::FlatSymbolRefAttr getFieldNameAttr() {
952 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().field_name);
953 }
954
955 ::llvm::StringRef getFieldName();
956 void setFieldNameAttr(::mlir::FlatSymbolRefAttr attr) {
957 getProperties().field_name = attr;
958 }
959
960 void setFieldName(::llvm::StringRef attrValue);
961 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr field_name, ::mlir::Value val);
962 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::mlir::FlatSymbolRefAttr field_name, ::mlir::Value val);
963 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::llvm::StringRef field_name, ::mlir::Value val);
964 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::llvm::StringRef field_name, ::mlir::Value val);
965 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
966 ::llvm::LogicalResult verifyInvariantsImpl();
967 ::llvm::LogicalResult verifyInvariants();
968 bool isRead();
969 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
970 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
971 void print(::mlir::OpAsmPrinter &_odsPrinter);
972private:
973 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
974 return getAttributeNameForIndex((*this)->getName(), index);
975 }
976
977 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
978 assert(index < 1 && "invalid attribute index");
979 assert(name.getStringRef() == getOperationName() && "invalid operation name");
980 assert(name.isRegistered() && "Operation isn't registered, missing a "
981 "dependent dialect loading?");
982 return name.getAttributeNames()[index];
983 }
984
985public:
987 inline ::mlir::FailureOr<SymbolLookupResult<FieldDefOp>> getFieldDefOp(::mlir::SymbolTableCollection &tables) {
988 return ::llvm::cast<FieldRefOpInterface>(getOperation()).getFieldDefOp(tables);
989 }
990};
991} // namespace component
992} // namespace llzk
993MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::FieldWriteOp)
994
995namespace llzk {
996namespace component {
997
998//===----------------------------------------------------------------------===//
999// ::llzk::component::StructDefOp declarations
1000//===----------------------------------------------------------------------===//
1001
1002namespace detail {
1004public:
1005 struct Properties {
1006 using const_paramsTy = ::mlir::ArrayAttr;
1008
1010 auto &propStorage = this->const_params;
1011 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
1012 }
1013 void setConstParams(const ::mlir::ArrayAttr &propValue) {
1014 this->const_params = propValue;
1015 }
1016 using sym_nameTy = ::mlir::StringAttr;
1018
1019 auto getSymName() {
1020 auto &propStorage = this->sym_name;
1021 return ::llvm::cast<::mlir::StringAttr>(propStorage);
1022 }
1023 void setSymName(const ::mlir::StringAttr &propValue) {
1024 this->sym_name = propValue;
1025 }
1026 bool operator==(const Properties &rhs) const {
1027 return
1028 rhs.const_params == this->const_params &&
1029 rhs.sym_name == this->sym_name &&
1030 true;
1031 }
1032 bool operator!=(const Properties &rhs) const {
1033 return !(*this == rhs);
1034 }
1035 };
1036protected:
1037 ::mlir::DictionaryAttr odsAttrs;
1038 ::std::optional<::mlir::OperationName> odsOpName;
1040 ::mlir::RegionRange odsRegions;
1041public:
1042 StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
1043 odsOpName.emplace("struct.def", odsAttrs.getContext());
1044 }
1045
1047
1048 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1049 return {index, 1};
1050 }
1051
1053 return properties;
1054 }
1055
1056 ::mlir::DictionaryAttr getAttributes() {
1057 return odsAttrs;
1058 }
1059
1060 ::mlir::StringAttr getSymNameAttr() {
1061 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
1062 return attr;
1063 }
1064
1065 ::llvm::StringRef getSymName();
1066 ::mlir::ArrayAttr getConstParamsAttr() {
1067 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().const_params);
1068 return attr;
1069 }
1070
1071 ::std::optional< ::mlir::ArrayAttr > getConstParams();
1072 ::mlir::Region &getBodyRegion() {
1073 return *odsRegions[0];
1074 }
1075
1076 ::mlir::RegionRange getRegions() {
1077 return odsRegions;
1078 }
1079
1080};
1081} // namespace detail
1082template <typename RangeT>
1084 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
1086public:
1087 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
1088
1089 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : StructDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
1090
1091 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : StructDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
1092
1093 StructDefOpGenericAdaptor(RangeT values, const StructDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
1094
1095 template <typename LateInst = StructDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, StructDefOp>>>
1096 StructDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
1097
1098 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
1099 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
1100 }
1101
1102 RangeT getODSOperands(unsigned index) {
1103 auto valueRange = getODSOperandIndexAndLength(index);
1104 return {std::next(odsOperands.begin(), valueRange.first),
1105 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
1106 }
1107
1108 RangeT getOperands() {
1109 return odsOperands;
1110 }
1111
1112private:
1113 RangeT odsOperands;
1114};
1115class StructDefOpAdaptor : public StructDefOpGenericAdaptor<::mlir::ValueRange> {
1116public:
1119
1120 ::llvm::LogicalResult verify(::mlir::Location loc);
1121};
1122class StructDefOp : public ::mlir::Op<StructDefOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::mlir::ModuleOp>::Impl, ::llzk::component::SetFuncAllowAttrs, ::mlir::OpTrait::NoRegionArguments, ::mlir::OpTrait::NoTerminator, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolOpInterface::Trait, ::mlir::OpTrait::SymbolTable, ::mlir::OpTrait::IsIsolatedFromAbove, ::mlir::SymbolUserOpInterface::Trait, ::mlir::RegionKindInterface::Trait, ::mlir::OpTrait::HasOnlyGraphRegion> {
1123public:
1124 using Op::Op;
1125 using Op::print;
1127 template <typename RangeT>
1131 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
1132 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("const_params"), ::llvm::StringRef("sym_name")};
1133 return ::llvm::ArrayRef(attrNames);
1134 }
1135
1136 ::mlir::StringAttr getConstParamsAttrName() {
1137 return getAttributeNameForIndex(0);
1138 }
1139
1140 static ::mlir::StringAttr getConstParamsAttrName(::mlir::OperationName name) {
1141 return getAttributeNameForIndex(name, 0);
1142 }
1143
1144 ::mlir::StringAttr getSymNameAttrName() {
1145 return getAttributeNameForIndex(1);
1146 }
1147
1148 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
1149 return getAttributeNameForIndex(name, 1);
1150 }
1151
1152 static constexpr ::llvm::StringLiteral getOperationName() {
1153 return ::llvm::StringLiteral("struct.def");
1154 }
1155
1156 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
1157 return {index, 1};
1158 }
1159
1160 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
1161 auto valueRange = getODSOperandIndexAndLength(index);
1162 return {std::next(getOperation()->operand_begin(), valueRange.first),
1163 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1164 }
1165
1166 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
1167 return {index, 1};
1168 }
1169
1170 ::mlir::Operation::result_range getODSResults(unsigned index) {
1171 auto valueRange = getODSResultIndexAndLength(index);
1172 return {std::next(getOperation()->result_begin(), valueRange.first),
1173 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1174 }
1175
1176 ::mlir::Region &getBodyRegion() {
1177 return (*this)->getRegion(0);
1178 }
1179
1180 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1181 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
1182 static llvm::hash_code computePropertiesHash(const Properties &prop);
1183 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
1184 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
1185 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
1186 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1187 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
1188 void writeProperties(::mlir::DialectBytecodeWriter &writer);
1189 ::mlir::StringAttr getSymNameAttr() {
1190 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
1191 }
1192
1193 ::llvm::StringRef getSymName();
1194 ::mlir::ArrayAttr getConstParamsAttr() {
1195 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().const_params);
1196 }
1197
1198 ::std::optional< ::mlir::ArrayAttr > getConstParams();
1199 void setSymNameAttr(::mlir::StringAttr attr) {
1200 getProperties().sym_name = attr;
1201 }
1202
1203 void setSymName(::llvm::StringRef attrValue);
1204 void setConstParamsAttr(::mlir::ArrayAttr attr) {
1205 getProperties().const_params = attr;
1206 }
1207
1208 ::mlir::Attribute removeConstParamsAttr() {
1209 auto &attr = getProperties().const_params;
1210 attr = {};
1211 return attr;
1212 }
1213
1214 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, /*optional*/::mlir::ArrayAttr const_params);
1215 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, /*optional*/::mlir::ArrayAttr const_params);
1216 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, /*optional*/::mlir::ArrayAttr const_params);
1217 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, /*optional*/::mlir::ArrayAttr const_params);
1218 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1219 ::llvm::LogicalResult verifyInvariantsImpl();
1220 ::llvm::LogicalResult verifyInvariants();
1221 ::llvm::LogicalResult verifyRegions();
1222 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
1223 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
1224 void print(::mlir::OpAsmPrinter &_odsPrinter);
1225private:
1226 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
1227 return getAttributeNameForIndex((*this)->getName(), index);
1228 }
1229
1230 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
1231 assert(index < 2 && "invalid attribute index");
1232 assert(name.getStringRef() == getOperationName() && "invalid operation name");
1233 assert(name.isRegistered() && "Operation isn't registered, missing a "
1234 "dependent dialect loading?");
1235 return name.getAttributeNames()[index];
1236 }
1237
1238public:
1241 StructType getType(::std::optional<::mlir::ArrayAttr> constParams = {});
1242 inline StructType getType(::std::optional<::mlir::ArrayAttr> constParams = {}) const {
1243 return const_cast<StructDefOp*>(this)->getType(constParams);
1244 }
1245
1248 FieldDefOp getFieldDef(::mlir::StringAttr fieldName);
1249
1251 ::std::vector<FieldDefOp> getFieldDefs();
1252
1254 ::mlir::LogicalResult hasColumns() {
1255 return ::mlir::success(::llvm::any_of(getFieldDefs(), [](FieldDefOp fdOp) {
1256 return fdOp.getColumn();
1257 }));
1258 }
1259
1262
1265
1268
1271
1273 bool hasComputeConstrain() { return lookupSymbol(FUNC_NAME_COMPUTE) != nullptr && lookupSymbol(FUNC_NAME_CONSTRAIN) != nullptr; }
1274
1276 ::std::string getHeaderString();
1277
1279 bool hasConstParamsAttr() { return getProperties().const_params != nullptr; };
1280
1282 bool hasParamNamed(::mlir::StringAttr find);
1283 inline bool hasParamNamed(::mlir::FlatSymbolRefAttr find) {
1284 return hasParamNamed(find.getRootReference());
1285 }
1286
1287 //===------------------------------------------------------------------===//
1288 // Utility Methods
1289 //===------------------------------------------------------------------===//
1290
1293 ::mlir::SymbolRefAttr getFullyQualifiedName();
1294
1296 bool isMainComponent();
1297};
1298} // namespace component
1299} // namespace llzk
1300MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::StructDefOp)
1301
1302
1303#endif // GET_OP_CLASSES
1304
MlirStringRef name
Definition Poly.cpp:48
CreateStructOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:74
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:182
CreateStructOpAdaptor(CreateStructOp op)
Definition Ops.cpp.inc:180
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:83
CreateStructOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:74
CreateStructOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:76
CreateStructOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:81
CreateStructOpGenericAdaptor(RangeT values, const CreateStructOpGenericAdaptorBase &base)
Definition Ops.h.inc:78
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:133
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result)
Definition Ops.cpp.inc:186
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:127
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:123
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:137
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:203
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:690
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:216
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:686
CreateStructOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:113
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:119
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:114
::mlir::TypedValue<::llzk::component::StructType > getResult()
Definition Ops.h.inc:143
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:115
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:220
CreateStructOpAdaptor Adaptor
Definition Ops.h.inc:111
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:241
FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:259
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:296
FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:259
FieldDefOpGenericAdaptor(RangeT values, const FieldDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:265
FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:261
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:274
FieldDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:263
FieldDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:268
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:270
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:431
void setColumnAttr(::mlir::UnitAttr attr)
Definition Ops.h.inc:390
FoldAdaptor::Properties Properties
Definition Ops.h.inc:302
::mlir::StringAttr getColumnAttrName()
Definition Ops.h.inc:308
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::Type type, bool isColumn=false)
void setPublicAttr(bool newValue=true)
Definition Ops.cpp:483
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:518
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:460
void setColumn(bool attrValue)
Definition Ops.cpp.inc:506
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:316
::mlir::TypeAttr getTypeAttr()
Definition Ops.h.inc:370
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:380
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute > attributes, bool isColumn=false)
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:439
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:395
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type, bool isColumn=false)
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:566
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:536
::mlir::StringAttr getTypeAttrName()
Definition Ops.h.inc:324
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:414
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:301
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:320
FieldDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:300
::mlir::StringAttr getColumnAttrName(::mlir::OperationName name)
Definition Ops.h.inc:312
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:402
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:346
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:473
::mlir::StringAttr getTypeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:328
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:303
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:336
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:498
FieldDefOpAdaptor Adaptor
Definition Ops.h.inc:298
void setType(::mlir::Type attrValue)
Definition Ops.cpp.inc:502
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:332
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:350
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:365
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:481
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:340
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:540
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:314
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:514
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:365
::mlir::Attribute removeColumnAttr()
Definition Ops.h.inc:395
::mlir::UnitAttr getColumnAttr()
Definition Ops.h.inc:375
void setTypeAttr(::mlir::TypeAttr attr)
Definition Ops.h.inc:385
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:644
FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:542
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:553
FieldReadOpGenericAdaptor(RangeT values, const FieldReadOpGenericAdaptorBase &base)
Definition Ops.h.inc:548
FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:544
::llvm::SmallVector< RangeT > getMapOperands()
Definition Ops.h.inc:567
FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:542
FieldReadOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:551
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:557
FieldReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:546
FoldAdaptor::Properties Properties
Definition Ops.h.inc:601
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:623
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:654
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:684
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:674
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:697
::mlir::StringAttr getFieldNameAttrName()
Definition Ops.h.inc:607
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:690
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:847
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:924
::mlir::StringAttr getTableOffsetAttrName()
Definition Ops.h.inc:631
::llvm::StringRef getFieldName()
Definition Ops.cpp.inc:900
::mlir::StringAttr getFieldNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:611
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:702
::llvm::LogicalResult verify()
Definition Ops.cpp:671
::mlir::OpOperand & getComponentMutable()
Definition Ops.h.inc:658
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field)
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:600
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:942
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1125
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:650
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:910
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::ArrayRef<::mlir::NamedAttribute > attrs)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:800
inline ::mlir::FailureOr< SymbolLookupResult< FieldDefOp > > getFieldDefOp(::mlir::SymbolTableCollection &tables)
Gets the definition for the field referenced in this op.
Definition Ops.h.inc:760
FieldReadOpAdaptor Adaptor
Definition Ops.h.inc:597
::mlir::FlatSymbolRefAttr getFieldNameAttr()
Definition Ops.h.inc:687
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr field, ::mlir::Attribute dist, ::mlir::ValueRange mapOperands, std::optional< int32_t > numDims)
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:996
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:615
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:668
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:948
::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:619
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:716
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:644
::mlir::StringAttr getTableOffsetAttrName(::mlir::OperationName name)
Definition Ops.h.inc:635
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:597
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:639
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:928
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:905
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:837
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1002
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:721
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:815
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:755
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:792
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:915
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:664
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:666
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:874
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:627
void setFieldName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:920
::mlir::Attribute removeTableOffsetAttr()
Definition Ops.h.inc:726
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:602
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:890
void setFieldNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:707
::mlir::Attribute getTableOffsetAttr()
Definition Ops.h.inc:692
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1082
FieldReadOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:599
void setTableOffsetAttr(::mlir::Attribute attr)
Definition Ops.h.inc:712
FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:835
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1150
FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:839
FieldWriteOpGenericAdaptor(RangeT values, const FieldWriteOpGenericAdaptorBase &base)
Definition Ops.h.inc:841
FieldWriteOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:844
FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:835
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:846
FieldWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:837
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:850
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1236
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1422
::llvm::StringRef getFieldName()
Definition Ops.cpp.inc:1241
FieldWriteOpAdaptor Adaptor
Definition Ops.h.inc:882
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:932
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1229
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1220
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:936
void setFieldName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1246
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1324
::mlir::StringAttr getFieldNameAttrName()
Definition Ops.h.inc:892
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:885
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1216
::mlir::StringAttr getFieldNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:896
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:914
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:904
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1296
::mlir::OpOperand & getValMutable()
Definition Ops.h.inc:927
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1182
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:908
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1159
inline ::mlir::FailureOr< SymbolLookupResult< FieldDefOp > > getFieldDefOp(::mlir::SymbolTableCollection &tables)
Gets the definition for the field referenced in this op.
Definition Ops.h.inc:987
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:918
::mlir::FlatSymbolRefAttr getFieldNameAttr()
Definition Ops.h.inc:951
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:615
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr field_name, ::mlir::Value val)
Definition Ops.cpp.inc:1250
::mlir::OpOperand & getComponentMutable()
Definition Ops.h.inc:922
FieldWriteOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:884
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:887
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:900
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1320
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1209
FoldAdaptor::Properties Properties
Definition Ops.h.inc:886
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1198
void setFieldNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:956
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1389
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1203
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1087
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1452
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:1091
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:1098
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1089
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:1102
StructDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:1096
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1087
StructDefOpGenericAdaptor(RangeT values, const StructDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:1093
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1525
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1531
::mlir::LogicalResult hasColumns()
Returns wether the struct defines fields marked as columns.
Definition Ops.h.inc:1254
StructType getType(::std::optional<::mlir::ArrayAttr > constParams={}) const
Definition Ops.h.inc:1242
StructType getType(::std::optional<::mlir::ArrayAttr > constParams={})
Gets the StructType representing this struct.
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:1148
FieldDefOp getFieldDef(::mlir::StringAttr fieldName)
Gets the FieldDefOp that defines the field in this structure with the given name, if present.
Definition Ops.cpp:402
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1540
::mlir::Region & getBodyRegion()
Definition Ops.h.inc:1176
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:189
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1573
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1152
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1552
::llzk::function::FuncDefOp getConstrainOrProductFuncOp()
Gets the FuncDefOp that defines the constrain function in this structure, if present,...
Definition Ops.cpp:438
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1680
::std::vector< FieldDefOp > getFieldDefs()
Get all FieldDefOp in this structure.
Definition Ops.cpp:413
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1502
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1590
::mlir::Attribute removeConstParamsAttr()
Definition Ops.h.inc:1208
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:1199
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:1156
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1170
StructDefOpAdaptor Adaptor
Definition Ops.h.inc:1126
::mlir::SymbolRefAttr getFullyQualifiedName()
Return the full name for this struct from the root module, including any surrounding module scopes.
Definition Ops.cpp:183
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1130
::mlir::StringAttr getConstParamsAttrName()
Definition Ops.h.inc:1136
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1160
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1558
bool hasParamNamed(::mlir::FlatSymbolRefAttr find)
Definition Ops.h.inc:1283
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1684
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1583
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1465
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:1166
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::ArrayAttr const_params)
Definition Ops.cpp.inc:1604
::llzk::function::FuncDefOp getConstrainFuncOp()
Gets the FuncDefOp that defines the constrain function in this structure, if present,...
Definition Ops.cpp:427
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:1189
::llzk::function::FuncDefOp getComputeOrProductFuncOp()
Gets the FuncDefOp that defines the compute function in this structure, if present,...
Definition Ops.cpp:431
::mlir::StringAttr getConstParamsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:1140
::std::optional< ::mlir::ArrayAttr > getConstParams()
Definition Ops.cpp.inc:1595
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1600
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:1129
bool hasParamNamed(::mlir::StringAttr find)
Return true iff this StructDefOp has a parameter with the given name.
::llvm::LogicalResult verifyRegions()
Definition Ops.cpp:314
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1660
::mlir::ArrayAttr getConstParamsAttr()
Definition Ops.h.inc:1194
::llzk::function::FuncDefOp getComputeFuncOp()
Gets the FuncDefOp that defines the compute function in this structure, if present,...
Definition Ops.cpp:423
bool hasComputeConstrain()
Returns true iff this structure defines compute and constrain functions.
Definition Ops.h.inc:1273
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1144
bool isMainComponent()
Return true iff this StructDefOp is named "Main".
Definition Ops.cpp:445
bool hasConstParamsAttr()
Return false iff getConstParamsAttr() returns nullptr
Definition Ops.h.inc:1279
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:1131
StructDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:1128
void setConstParamsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:1204
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1719
::std::string getHeaderString()
Generate header string, in the same format as the assemblyFormat.
Definition Ops.cpp:155
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:50
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:59
CreateStructOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:53
FieldDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:220
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:216
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:226
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:598
FieldReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:500
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:621
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:529
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:496
FieldWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:804
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:800
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:810
::std::optional< ::mlir::ArrayAttr > getConstParams()
Definition Ops.cpp.inc:1444
StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1042
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1038
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:1048
constexpr char FUNC_NAME_COMPUTE[]
Symbol name for the witness generation (and resp.
Definition Constants.h:27
constexpr char FUNC_NAME_CONSTRAIN[]
Definition Constants.h:28
llvm::StringLiteral getOperationName()
Get the operation name, like "constrain.eq" for the given OpClass.
Definition OpHelpers.h:27
void setColumn(const ::mlir::UnitAttr &propValue)
Definition Ops.h.inc:180
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:190
void setType(const ::mlir::TypeAttr &propValue)
Definition Ops.h.inc:200
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:459
void setTableOffset(const ::mlir::Attribute &propValue)
Definition Ops.h.inc:479
void setFieldName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:449
void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:469
void setFieldName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:786
void setConstParams(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:1013
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:1023