LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
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 MemberDefOp;
18} // namespace component
19} // namespace llzk
20namespace llzk {
21namespace component {
22class MemberReadOp;
23} // namespace component
24} // namespace llzk
25namespace llzk {
26namespace component {
27class MemberWriteOp;
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::MemberDefOp 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 signalTy = ::mlir::UnitAttr;
185
186 auto getSignal() {
187 auto &propStorage = this->signal;
188 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(propStorage);
189 }
190 void setSignal(const ::mlir::UnitAttr &propValue) {
191 this->signal = propValue;
192 }
193 using sym_nameTy = ::mlir::StringAttr;
195
196 auto getSymName() {
197 auto &propStorage = this->sym_name;
198 return ::llvm::cast<::mlir::StringAttr>(propStorage);
199 }
200 void setSymName(const ::mlir::StringAttr &propValue) {
201 this->sym_name = propValue;
202 }
203 using typeTy = ::mlir::TypeAttr;
205
206 auto getType() {
207 auto &propStorage = this->type;
208 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
209 }
210 void setType(const ::mlir::TypeAttr &propValue) {
211 this->type = propValue;
212 }
213 bool operator==(const Properties &rhs) const {
214 return
215 rhs.column == this->column &&
216 rhs.signal == this->signal &&
217 rhs.sym_name == this->sym_name &&
218 rhs.type == this->type &&
219 true;
220 }
221 bool operator!=(const Properties &rhs) const {
222 return !(*this == rhs);
223 }
224 };
225protected:
226 ::mlir::DictionaryAttr odsAttrs;
227 ::std::optional<::mlir::OperationName> odsOpName;
229 ::mlir::RegionRange odsRegions;
230public:
231 MemberDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
232 odsOpName.emplace("struct.member", odsAttrs.getContext());
233 }
234
236
237 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
238 return {index, 1};
239 }
240
242 return properties;
243 }
244
245 ::mlir::DictionaryAttr getAttributes() {
246 return odsAttrs;
247 }
248
249 ::mlir::StringAttr getSymNameAttr() {
250 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
251 return attr;
252 }
253
254 ::llvm::StringRef getSymName();
255 ::mlir::TypeAttr getTypeAttr() {
256 auto attr = ::llvm::cast<::mlir::TypeAttr>(getProperties().type);
257 return attr;
258 }
259
260 ::mlir::Type getType();
261 ::mlir::UnitAttr getColumnAttr();
262 bool getColumn();
263 ::mlir::UnitAttr getSignalAttr();
264 bool getSignal();
265};
266} // namespace detail
267template <typename RangeT>
269 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
271public:
272 MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
273
274 MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : MemberDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
275
276 MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MemberDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
277
278 MemberDefOpGenericAdaptor(RangeT values, const MemberDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
279
280 template <typename LateInst = MemberDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, MemberDefOp>>>
281 MemberDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
282
283 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
284 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
285 }
286
287 RangeT getODSOperands(unsigned index) {
288 auto valueRange = getODSOperandIndexAndLength(index);
289 return {std::next(odsOperands.begin(), valueRange.first),
290 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
291 }
292
293 RangeT getOperands() {
294 return odsOperands;
295 }
296
297private:
298 RangeT odsOperands;
299};
300class MemberDefOpAdaptor : public MemberDefOpGenericAdaptor<::mlir::ValueRange> {
301public:
304
305 ::llvm::LogicalResult verify(::mlir::Location loc);
306};
307class MemberDefOp : public ::mlir::Op<MemberDefOp, ::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> {
308public:
309 using Op::Op;
310 using Op::print;
312 template <typename RangeT>
316 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
317 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("column"), ::llvm::StringRef("signal"), ::llvm::StringRef("sym_name"), ::llvm::StringRef("type")};
318 return ::llvm::ArrayRef(attrNames);
319 }
320
321 ::mlir::StringAttr getColumnAttrName() {
322 return getAttributeNameForIndex(0);
323 }
324
325 static ::mlir::StringAttr getColumnAttrName(::mlir::OperationName name) {
326 return getAttributeNameForIndex(name, 0);
327 }
328
329 ::mlir::StringAttr getSignalAttrName() {
330 return getAttributeNameForIndex(1);
331 }
332
333 static ::mlir::StringAttr getSignalAttrName(::mlir::OperationName name) {
334 return getAttributeNameForIndex(name, 1);
335 }
336
337 ::mlir::StringAttr getSymNameAttrName() {
338 return getAttributeNameForIndex(2);
339 }
340
341 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
342 return getAttributeNameForIndex(name, 2);
343 }
344
345 ::mlir::StringAttr getTypeAttrName() {
346 return getAttributeNameForIndex(3);
347 }
348
349 static ::mlir::StringAttr getTypeAttrName(::mlir::OperationName name) {
350 return getAttributeNameForIndex(name, 3);
351 }
352
353 static constexpr ::llvm::StringLiteral getOperationName() {
354 return ::llvm::StringLiteral("struct.member");
355 }
356
357 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
358 return {index, 1};
359 }
360
361 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
362 auto valueRange = getODSOperandIndexAndLength(index);
363 return {std::next(getOperation()->operand_begin(), valueRange.first),
364 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
365 }
366
367 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
368 return {index, 1};
369 }
370
371 ::mlir::Operation::result_range getODSResults(unsigned index) {
372 auto valueRange = getODSResultIndexAndLength(index);
373 return {std::next(getOperation()->result_begin(), valueRange.first),
374 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
375 }
376
377 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
378 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
379 static llvm::hash_code computePropertiesHash(const Properties &prop);
380 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
381 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
382 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
383 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
384 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
385 void writeProperties(::mlir::DialectBytecodeWriter &writer);
386 ::mlir::StringAttr getSymNameAttr() {
387 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
388 }
389
390 ::llvm::StringRef getSymName();
391 ::mlir::TypeAttr getTypeAttr() {
392 return ::llvm::cast<::mlir::TypeAttr>(getProperties().type);
393 }
394
395 ::mlir::Type getType();
396 ::mlir::UnitAttr getColumnAttr() {
397 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().column);
398 }
399
400 bool getColumn();
401 ::mlir::UnitAttr getSignalAttr() {
402 return ::llvm::dyn_cast_or_null<::mlir::UnitAttr>(getProperties().signal);
403 }
404
405 bool getSignal();
406 void setSymNameAttr(::mlir::StringAttr attr) {
407 getProperties().sym_name = attr;
408 }
409
410 void setSymName(::llvm::StringRef attrValue);
411 void setTypeAttr(::mlir::TypeAttr attr) {
412 getProperties().type = attr;
413 }
414
415 void setType(::mlir::Type attrValue);
416 void setColumnAttr(::mlir::UnitAttr attr) {
417 getProperties().column = attr;
418 }
419
420 void setColumn(bool attrValue);
421 void setSignalAttr(::mlir::UnitAttr attr) {
422 getProperties().signal = attr;
423 }
424
425 void setSignal(bool attrValue);
426 ::mlir::Attribute removeColumnAttr() {
427 auto &attr = getProperties().column;
428 attr = {};
429 return attr;
430 }
431
432 ::mlir::Attribute removeSignalAttr() {
433 auto &attr = getProperties().signal;
434 attr = {};
435 return attr;
436 }
437
438 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type, bool isSignal = false, bool isColumn = false);
439 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::Type type, bool isSignal = false, bool isColumn = false);
440 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, bool isSignal = false, bool isColumn = false);
441 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes, bool isSignal = false, bool isColumn = false);
442 ::llvm::LogicalResult verifyInvariantsImpl();
443 ::llvm::LogicalResult verifyInvariants();
444 ::llvm::LogicalResult verify();
445 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
446 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
447 void print(::mlir::OpAsmPrinter &_odsPrinter);
448private:
449 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
450 return getAttributeNameForIndex((*this)->getName(), index);
451 }
452
453 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
454 assert(index < 4 && "invalid attribute index");
455 assert(name.getStringRef() == getOperationName() && "invalid operation name");
456 assert(name.isRegistered() && "Operation isn't registered, missing a "
457 "dependent dialect loading?");
458 return name.getAttributeNames()[index];
459 }
460
461public:
462 inline bool hasPublicAttr() { return getOperation()->hasAttr(llzk::PublicAttr::name); }
463 void setPublicAttr(bool newValue = true);
464};
465} // namespace component
466} // namespace llzk
467MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::MemberDefOp)
468
469namespace llzk {
470namespace component {
471
472//===----------------------------------------------------------------------===//
473// ::llzk::component::MemberReadOp declarations
474//===----------------------------------------------------------------------===//
475
476namespace detail {
478public:
479 struct Properties {
480 using mapOpGroupSizesTy = ::mlir::DenseI32ArrayAttr;
482
484 auto &propStorage = this->mapOpGroupSizes;
485 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
486 }
487 void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue) {
488 this->mapOpGroupSizes = propValue;
489 }
490 using member_nameTy = ::mlir::FlatSymbolRefAttr;
492
494 auto &propStorage = this->member_name;
495 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
496 }
497 void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue) {
498 this->member_name = propValue;
499 }
500 using numDimsPerMapTy = ::mlir::DenseI32ArrayAttr;
502
504 auto &propStorage = this->numDimsPerMap;
505 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
506 }
507 void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue) {
508 this->numDimsPerMap = propValue;
509 }
510 using tableOffsetTy = ::mlir::Attribute;
512
514 auto &propStorage = this->tableOffset;
515 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(propStorage);
516 }
517 void setTableOffset(const ::mlir::Attribute &propValue) {
518 this->tableOffset = propValue;
519 }
520 bool operator==(const Properties &rhs) const {
521 return
522 rhs.mapOpGroupSizes == this->mapOpGroupSizes &&
523 rhs.member_name == this->member_name &&
524 rhs.numDimsPerMap == this->numDimsPerMap &&
525 rhs.tableOffset == this->tableOffset &&
526 true;
527 }
528 bool operator!=(const Properties &rhs) const {
529 return !(*this == rhs);
530 }
531 };
532protected:
533 ::mlir::DictionaryAttr odsAttrs;
534 ::std::optional<::mlir::OperationName> odsOpName;
536 ::mlir::RegionRange odsRegions;
537public:
538 MemberReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
539 odsOpName.emplace("struct.readm", odsAttrs.getContext());
540 }
541
543
544 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
546 return properties;
547 }
548
549 ::mlir::DictionaryAttr getAttributes() {
550 return odsAttrs;
551 }
552
553 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
554 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
555 return attr;
556 }
557
558 ::llvm::StringRef getMemberName();
559 ::mlir::Attribute getTableOffsetAttr() {
560 auto attr = ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().tableOffset);
561 return attr;
562 }
563
564 ::std::optional<::mlir::Attribute> getTableOffset();
565 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
566 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
567 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
568 auto attr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
569 return attr;
570 }
571
572 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
573};
574} // namespace detail
575template <typename RangeT>
577 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
579public:
580 MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
581
582 MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : MemberReadOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
583
584 MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MemberReadOpGenericAdaptor(values, attrs, Properties{}, {}) {}
585
586 MemberReadOpGenericAdaptor(RangeT values, const MemberReadOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
587
588 template <typename LateInst = MemberReadOp, typename = std::enable_if_t<std::is_same_v<LateInst, MemberReadOp>>>
589 MemberReadOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
590
591 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
592 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
593 }
594
595 RangeT getODSOperands(unsigned index) {
596 auto valueRange = getODSOperandIndexAndLength(index);
597 return {std::next(odsOperands.begin(), valueRange.first),
598 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
599 }
600
601 ValueT getComponent() {
602 return (*getODSOperands(0).begin());
603 }
604
605 ::llvm::SmallVector<RangeT> getMapOperands() {
606 auto tblgenTmpOperands = getODSOperands(1);
607 auto sizes = getMapOpGroupSizes();
608
609 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
610 for (int i = 0, e = sizes.size(); i < e; ++i) {
611 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
612 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
613 }
614 return tblgenTmpOperandGroups;
615 }
616
617 RangeT getOperands() {
618 return odsOperands;
619 }
620
621private:
622 RangeT odsOperands;
623};
624class MemberReadOpAdaptor : public MemberReadOpGenericAdaptor<::mlir::ValueRange> {
625public:
628
629 ::llvm::LogicalResult verify(::mlir::Location loc);
630};
631class MemberReadOp : public ::mlir::Op<MemberReadOp, ::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::MemberRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
632public:
633 using Op::Op;
634 using Op::print;
636 template <typename RangeT>
640 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
641 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("mapOpGroupSizes"), ::llvm::StringRef("member_name"), ::llvm::StringRef("numDimsPerMap"), ::llvm::StringRef("tableOffset")};
642 return ::llvm::ArrayRef(attrNames);
643 }
644
645 ::mlir::StringAttr getMapOpGroupSizesAttrName() {
646 return getAttributeNameForIndex(0);
647 }
648
649 static ::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name) {
650 return getAttributeNameForIndex(name, 0);
651 }
652
653 ::mlir::StringAttr getMemberNameAttrName() {
654 return getAttributeNameForIndex(1);
655 }
656
657 static ::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name) {
658 return getAttributeNameForIndex(name, 1);
659 }
660
661 ::mlir::StringAttr getNumDimsPerMapAttrName() {
662 return getAttributeNameForIndex(2);
663 }
664
665 static ::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name) {
666 return getAttributeNameForIndex(name, 2);
667 }
668
669 ::mlir::StringAttr getTableOffsetAttrName() {
670 return getAttributeNameForIndex(3);
671 }
672
673 static ::mlir::StringAttr getTableOffsetAttrName(::mlir::OperationName name) {
674 return getAttributeNameForIndex(name, 3);
675 }
676
677 static constexpr ::llvm::StringLiteral getOperationName() {
678 return ::llvm::StringLiteral("struct.readm");
679 }
680
681 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
682 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
683 auto valueRange = getODSOperandIndexAndLength(index);
684 return {std::next(getOperation()->operand_begin(), valueRange.first),
685 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
686 }
687
688 ::mlir::TypedValue<::llzk::component::StructType> getComponent() {
689 return ::llvm::cast<::mlir::TypedValue<::llzk::component::StructType>>(*getODSOperands(0).begin());
690 }
691
692 ::mlir::OperandRangeRange getMapOperands() {
693 return getODSOperands(1).split(getMapOpGroupSizesAttr());
694 }
695
696 ::mlir::OpOperand &getComponentMutable() {
697 auto range = getODSOperandIndexAndLength(0);
698 return getOperation()->getOpOperand(range.first);
699 }
700
701 ::mlir::MutableOperandRangeRange getMapOperandsMutable();
702 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
703 return {index, 1};
704 }
705
706 ::mlir::Operation::result_range getODSResults(unsigned index) {
707 auto valueRange = getODSResultIndexAndLength(index);
708 return {std::next(getOperation()->result_begin(), valueRange.first),
709 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
710 }
711
712 ::mlir::TypedValue<::mlir::Type> getVal() {
713 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
714 }
715
716 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
717 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
718 static llvm::hash_code computePropertiesHash(const Properties &prop);
719 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
720 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
721 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
722 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
723 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
724 void writeProperties(::mlir::DialectBytecodeWriter &writer);
725 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
726 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
727 }
728
729 ::llvm::StringRef getMemberName();
730 ::mlir::Attribute getTableOffsetAttr() {
731 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().tableOffset);
732 }
733
734 ::std::optional<::mlir::Attribute> getTableOffset();
735 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr() {
736 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
737 }
738
739 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
740 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
741 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
742 }
743
744 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
745 void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr) {
746 getProperties().member_name = attr;
747 }
748
749 void setMemberName(::llvm::StringRef attrValue);
750 void setTableOffsetAttr(::mlir::Attribute attr) {
751 getProperties().tableOffset = attr;
752 }
753
754 void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr) {
755 getProperties().numDimsPerMap = attr;
756 }
757
758 void setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue);
759 void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr) {
760 getProperties().mapOpGroupSizes = attr;
761 }
762
763 void setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue);
764 ::mlir::Attribute removeTableOffsetAttr() {
765 auto &attr = getProperties().tableOffset;
766 attr = {};
767 return attr;
768 }
769
770 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member);
771 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::Attribute dist, ::mlir::ValueRange mapOperands, std::optional<int32_t> numDims);
772 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::SymbolRefAttr dist);
773 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::IntegerAttr dist);
774 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::ArrayRef<::mlir::NamedAttribute> attrs);
775 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
776 ::llvm::LogicalResult verifyInvariantsImpl();
777 ::llvm::LogicalResult verifyInvariants();
778 ::llvm::LogicalResult verify();
779 bool isRead();
780 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
781 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
782 void print(::mlir::OpAsmPrinter &_odsPrinter);
783private:
784 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
785 return getAttributeNameForIndex((*this)->getName(), index);
786 }
787
788 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
789 assert(index < 4 && "invalid attribute index");
790 assert(name.getStringRef() == getOperationName() && "invalid operation name");
791 assert(name.isRegistered() && "Operation isn't registered, missing a "
792 "dependent dialect loading?");
793 return name.getAttributeNames()[index];
794 }
795
796public:
798 inline ::mlir::FailureOr<SymbolLookupResult<MemberDefOp>> getMemberDefOp(::mlir::SymbolTableCollection &tables) {
799 return ::llvm::cast<MemberRefOpInterface>(getOperation()).getMemberDefOp(tables);
800 }
801};
802} // namespace component
803} // namespace llzk
804MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::MemberReadOp)
805
806namespace llzk {
807namespace component {
808
809//===----------------------------------------------------------------------===//
810// ::llzk::component::MemberWriteOp declarations
811//===----------------------------------------------------------------------===//
812
813namespace detail {
815public:
816 struct Properties {
817 using member_nameTy = ::mlir::FlatSymbolRefAttr;
819
821 auto &propStorage = this->member_name;
822 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
823 }
824 void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue) {
825 this->member_name = propValue;
826 }
827 bool operator==(const Properties &rhs) const {
828 return
829 rhs.member_name == this->member_name &&
830 true;
831 }
832 bool operator!=(const Properties &rhs) const {
833 return !(*this == rhs);
834 }
835 };
836protected:
837 ::mlir::DictionaryAttr odsAttrs;
838 ::std::optional<::mlir::OperationName> odsOpName;
840 ::mlir::RegionRange odsRegions;
841public:
842 MemberWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
843 odsOpName.emplace("struct.writem", odsAttrs.getContext());
844 }
845
847
848 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
849 return {index, 1};
850 }
851
853 return properties;
854 }
855
856 ::mlir::DictionaryAttr getAttributes() {
857 return odsAttrs;
858 }
859
860 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
861 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
862 return attr;
863 }
864
865 ::llvm::StringRef getMemberName();
866};
867} // namespace detail
868template <typename RangeT>
870 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
872public:
873 MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
874
875 MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : MemberWriteOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
876
877 MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MemberWriteOpGenericAdaptor(values, attrs, Properties{}, {}) {}
878
879 MemberWriteOpGenericAdaptor(RangeT values, const MemberWriteOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
880
881 template <typename LateInst = MemberWriteOp, typename = std::enable_if_t<std::is_same_v<LateInst, MemberWriteOp>>>
882 MemberWriteOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
883
884 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
885 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
886 }
887
888 RangeT getODSOperands(unsigned index) {
889 auto valueRange = getODSOperandIndexAndLength(index);
890 return {std::next(odsOperands.begin(), valueRange.first),
891 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
892 }
893
894 ValueT getComponent() {
895 return (*getODSOperands(0).begin());
896 }
897
898 ValueT getVal() {
899 return (*getODSOperands(1).begin());
900 }
901
902 RangeT getOperands() {
903 return odsOperands;
904 }
905
906private:
907 RangeT odsOperands;
908};
909class MemberWriteOpAdaptor : public MemberWriteOpGenericAdaptor<::mlir::ValueRange> {
910public:
913
914 ::llvm::LogicalResult verify(::mlir::Location loc);
915};
916class MemberWriteOp : public ::mlir::Op<MemberWriteOp, ::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::MemberRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
917public:
918 using Op::Op;
919 using Op::print;
921 template <typename RangeT>
925 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
926 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("member_name")};
927 return ::llvm::ArrayRef(attrNames);
928 }
929
930 ::mlir::StringAttr getMemberNameAttrName() {
931 return getAttributeNameForIndex(0);
932 }
933
934 static ::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name) {
935 return getAttributeNameForIndex(name, 0);
936 }
937
938 static constexpr ::llvm::StringLiteral getOperationName() {
939 return ::llvm::StringLiteral("struct.writem");
940 }
941
942 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
943 return {index, 1};
944 }
945
946 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
947 auto valueRange = getODSOperandIndexAndLength(index);
948 return {std::next(getOperation()->operand_begin(), valueRange.first),
949 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
950 }
951
952 ::mlir::TypedValue<::llzk::component::StructType> getComponent() {
953 return ::llvm::cast<::mlir::TypedValue<::llzk::component::StructType>>(*getODSOperands(0).begin());
954 }
955
956 ::mlir::TypedValue<::mlir::Type> getVal() {
957 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(1).begin());
958 }
959
960 ::mlir::OpOperand &getComponentMutable() {
961 auto range = getODSOperandIndexAndLength(0);
962 return getOperation()->getOpOperand(range.first);
963 }
964
965 ::mlir::OpOperand &getValMutable() {
966 auto range = getODSOperandIndexAndLength(1);
967 return getOperation()->getOpOperand(range.first);
968 }
969
970 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
971 return {index, 1};
972 }
973
974 ::mlir::Operation::result_range getODSResults(unsigned index) {
975 auto valueRange = getODSResultIndexAndLength(index);
976 return {std::next(getOperation()->result_begin(), valueRange.first),
977 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
978 }
979
980 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
981 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
982 static llvm::hash_code computePropertiesHash(const Properties &prop);
983 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
984 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
985 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
986 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
987 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
988 void writeProperties(::mlir::DialectBytecodeWriter &writer);
989 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
990 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
991 }
992
993 ::llvm::StringRef getMemberName();
994 void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr) {
995 getProperties().member_name = attr;
996 }
997
998 void setMemberName(::llvm::StringRef attrValue);
999 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val);
1000 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val);
1001 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::llvm::StringRef member_name, ::mlir::Value val);
1002 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::llvm::StringRef member_name, ::mlir::Value val);
1003 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1004 ::llvm::LogicalResult verifyInvariantsImpl();
1005 ::llvm::LogicalResult verifyInvariants();
1006 bool isRead();
1007 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
1008 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
1009 void print(::mlir::OpAsmPrinter &_odsPrinter);
1010private:
1011 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
1012 return getAttributeNameForIndex((*this)->getName(), index);
1013 }
1014
1015 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
1016 assert(index < 1 && "invalid attribute index");
1017 assert(name.getStringRef() == getOperationName() && "invalid operation name");
1018 assert(name.isRegistered() && "Operation isn't registered, missing a "
1019 "dependent dialect loading?");
1020 return name.getAttributeNames()[index];
1021 }
1022
1023public:
1025 inline ::mlir::FailureOr<SymbolLookupResult<MemberDefOp>> getMemberDefOp(::mlir::SymbolTableCollection &tables) {
1026 return ::llvm::cast<MemberRefOpInterface>(getOperation()).getMemberDefOp(tables);
1027 }
1028};
1029} // namespace component
1030} // namespace llzk
1031MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::MemberWriteOp)
1032
1033namespace llzk {
1034namespace component {
1035
1036//===----------------------------------------------------------------------===//
1037// ::llzk::component::StructDefOp declarations
1038//===----------------------------------------------------------------------===//
1039
1040namespace detail {
1042public:
1043 struct Properties {
1044 using sym_nameTy = ::mlir::StringAttr;
1046
1047 auto getSymName() {
1048 auto &propStorage = this->sym_name;
1049 return ::llvm::cast<::mlir::StringAttr>(propStorage);
1050 }
1051 void setSymName(const ::mlir::StringAttr &propValue) {
1052 this->sym_name = propValue;
1053 }
1054 bool operator==(const Properties &rhs) const {
1055 return
1056 rhs.sym_name == this->sym_name &&
1057 true;
1058 }
1059 bool operator!=(const Properties &rhs) const {
1060 return !(*this == rhs);
1061 }
1062 };
1063protected:
1064 ::mlir::DictionaryAttr odsAttrs;
1065 ::std::optional<::mlir::OperationName> odsOpName;
1067 ::mlir::RegionRange odsRegions;
1068public:
1069 StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
1070 odsOpName.emplace("struct.def", odsAttrs.getContext());
1071 }
1072
1074
1075 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1076 return {index, 1};
1077 }
1078
1080 return properties;
1081 }
1082
1083 ::mlir::DictionaryAttr getAttributes() {
1084 return odsAttrs;
1085 }
1086
1087 ::mlir::StringAttr getSymNameAttr() {
1088 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
1089 return attr;
1090 }
1091
1092 ::llvm::StringRef getSymName();
1093 ::mlir::Region &getBodyRegion() {
1094 return *odsRegions[0];
1095 }
1096
1097 ::mlir::RegionRange getRegions() {
1098 return odsRegions;
1099 }
1100
1101};
1102} // namespace detail
1103template <typename RangeT>
1105 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
1107public:
1108 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
1109
1110 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : StructDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
1111
1112 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : StructDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
1113
1114 StructDefOpGenericAdaptor(RangeT values, const StructDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
1115
1116 template <typename LateInst = StructDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, StructDefOp>>>
1117 StructDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
1118
1119 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
1120 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
1121 }
1122
1123 RangeT getODSOperands(unsigned index) {
1124 auto valueRange = getODSOperandIndexAndLength(index);
1125 return {std::next(odsOperands.begin(), valueRange.first),
1126 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
1127 }
1128
1129 RangeT getOperands() {
1130 return odsOperands;
1131 }
1132
1133private:
1134 RangeT odsOperands;
1135};
1136class StructDefOpAdaptor : public StructDefOpGenericAdaptor<::mlir::ValueRange> {
1137public:
1140
1141 ::llvm::LogicalResult verify(::mlir::Location loc);
1142};
1143class StructDefOp : public ::mlir::Op<StructDefOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::mlir::ModuleOp, ::llzk::polymorphic::TemplateOp>::Impl, ::llzk::component::SetFuncAllowAttrs, ::mlir::OpTrait::NoRegionArguments, ::mlir::OpTrait::NoTerminator, ::mlir::OpTrait::SingleBlock, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolOpInterface::Trait, ::llzk::LLZKSymbolTableImplTrait, ::mlir::OpTrait::SymbolTable, ::mlir::OpTrait::IsIsolatedFromAbove, ::mlir::RegionKindInterface::Trait, ::mlir::OpTrait::HasOnlyGraphRegion> {
1144public:
1145 using Op::Op;
1146 using Op::print;
1148 template <typename RangeT>
1152 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
1153 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("sym_name")};
1154 return ::llvm::ArrayRef(attrNames);
1155 }
1156
1157 ::mlir::StringAttr getSymNameAttrName() {
1158 return getAttributeNameForIndex(0);
1159 }
1160
1161 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
1162 return getAttributeNameForIndex(name, 0);
1163 }
1164
1165 static constexpr ::llvm::StringLiteral getOperationName() {
1166 return ::llvm::StringLiteral("struct.def");
1167 }
1168
1169 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
1170 return {index, 1};
1171 }
1172
1173 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
1174 auto valueRange = getODSOperandIndexAndLength(index);
1175 return {std::next(getOperation()->operand_begin(), valueRange.first),
1176 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1177 }
1178
1179 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
1180 return {index, 1};
1181 }
1182
1183 ::mlir::Operation::result_range getODSResults(unsigned index) {
1184 auto valueRange = getODSResultIndexAndLength(index);
1185 return {std::next(getOperation()->result_begin(), valueRange.first),
1186 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1187 }
1188
1189 ::mlir::Region &getBodyRegion() {
1190 return (*this)->getRegion(0);
1191 }
1192
1193 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1194 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
1195 static llvm::hash_code computePropertiesHash(const Properties &prop);
1196 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
1197 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
1198 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
1199 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1200 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
1201 void writeProperties(::mlir::DialectBytecodeWriter &writer);
1202 ::mlir::StringAttr getSymNameAttr() {
1203 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
1204 }
1205
1206 ::llvm::StringRef getSymName();
1207 void setSymNameAttr(::mlir::StringAttr attr) {
1208 getProperties().sym_name = attr;
1209 }
1210
1211 void setSymName(::llvm::StringRef attrValue);
1212 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name);
1213 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name);
1214 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name);
1215 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name);
1216 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1217 ::llvm::LogicalResult verifyInvariantsImpl();
1218 ::llvm::LogicalResult verifyInvariants();
1219 ::llvm::LogicalResult verifyRegions();
1220 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
1221 void print(::mlir::OpAsmPrinter &_odsPrinter);
1222private:
1223 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
1224 return getAttributeNameForIndex((*this)->getName(), index);
1225 }
1226
1227 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
1228 assert(index < 1 && "invalid attribute index");
1229 assert(name.getStringRef() == getOperationName() && "invalid operation name");
1230 assert(name.isRegistered() && "Operation isn't registered, missing a "
1231 "dependent dialect loading?");
1232 return name.getAttributeNames()[index];
1233 }
1234
1235public:
1238 StructType getType(::std::optional<::mlir::ArrayAttr> constParams = {});
1239 inline StructType getType(::std::optional<::mlir::ArrayAttr> constParams = {}) const {
1240 return const_cast<StructDefOp*>(this)->getType(constParams);
1241 }
1242
1245 MemberDefOp getMemberDef(::mlir::StringAttr memberName);
1246
1248 ::std::vector<MemberDefOp> getMemberDefs();
1249
1251 ::mlir::LogicalResult hasColumns() {
1252 return ::mlir::success(::llvm::any_of(getMemberDefs(), [](MemberDefOp memberOp) {
1253 return memberOp.getColumn();
1254 }));
1255 }
1256
1258 ::mlir::LogicalResult hasSignals() {
1259 return ::mlir::success(::llvm::any_of(getMemberDefs(), [](MemberDefOp memberOp) {
1260 return memberOp.getSignal();
1261 }));
1262 }
1263
1266
1269
1272
1274 bool hasComputeConstrain() { return lookupSymbol(FUNC_NAME_COMPUTE) != nullptr && lookupSymbol(FUNC_NAME_CONSTRAIN) != nullptr; }
1275
1277 ::std::string getHeaderString();
1278
1282
1287 ::llvm::SmallVector<::mlir::Attribute> getTemplateParamOpNames();
1288
1293 ::llvm::SmallVector<::mlir::Attribute> getTemplateExprOpNames();
1294
1297 ::mlir::SymbolRefAttr getFullyQualifiedName();
1298
1300 bool isMainComponent();
1301};
1302} // namespace component
1303} // namespace llzk
1304MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::StructDefOp)
1305
1306
1307#endif // GET_OP_CLASSES
1308
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:168
CreateStructOpAdaptor(CreateStructOp op)
Definition Ops.cpp.inc:166
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:172
::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:189
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:803
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:202
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:799
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:206
CreateStructOpAdaptor Adaptor
Definition Ops.h.inc:111
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:227
MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:272
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:296
MemberDefOpGenericAdaptor(RangeT values, const MemberDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:278
MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:272
MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:274
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:283
MemberDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:281
MemberDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:276
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:287
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:406
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:314
MemberDefOpAdaptor Adaptor
Definition Ops.h.inc:311
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:341
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:361
::mlir::StringAttr getColumnAttrName(::mlir::OperationName name)
Definition Ops.h.inc:325
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:528
void setSignal(bool attrValue)
Definition Ops.cpp.inc:568
::mlir::StringAttr getTypeAttrName()
Definition Ops.h.inc:345
::mlir::StringAttr getColumnAttrName()
Definition Ops.h.inc:321
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:602
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:428
MemberDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:313
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::Type type, bool isSignal=false, bool isColumn=false)
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:367
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:318
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:465
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:475
void setPublicAttr(bool newValue=true)
Definition Ops.cpp:566
::mlir::StringAttr getTypeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:349
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute > attributes, bool isSignal=false, bool isColumn=false)
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:608
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:580
void setColumnAttr(::mlir::UnitAttr attr)
Definition Ops.h.inc:416
::mlir::UnitAttr getSignalAttr()
Definition Ops.h.inc:401
void setTypeAttr(::mlir::TypeAttr attr)
Definition Ops.h.inc:411
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:634
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:383
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:353
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr type, bool isSignal=false, bool isColumn=false)
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:502
void setColumn(bool attrValue)
Definition Ops.cpp.inc:560
::mlir::Attribute removeSignalAttr()
Definition Ops.h.inc:432
::mlir::TypeAttr getTypeAttr()
Definition Ops.h.inc:391
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:443
::mlir::Attribute removeColumnAttr()
Definition Ops.h.inc:426
::mlir::StringAttr getSignalAttrName()
Definition Ops.h.inc:329
::mlir::StringAttr getSignalAttrName(::mlir::OperationName name)
Definition Ops.h.inc:333
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:357
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:420
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:386
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:597
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:518
void setType(::mlir::Type attrValue)
Definition Ops.cpp.inc:556
::llvm::LogicalResult verify()
Definition Ops.cpp:615
FoldAdaptor::Properties Properties
Definition Ops.h.inc:315
void setSignalAttr(::mlir::UnitAttr attr)
Definition Ops.h.inc:421
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:552
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:371
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:316
::mlir::UnitAttr getColumnAttr()
Definition Ops.h.inc:396
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:337
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:580
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:718
MemberReadOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:589
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:591
::llvm::SmallVector< RangeT > getMapOperands()
Definition Ops.h.inc:605
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:580
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:595
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:582
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:584
MemberReadOpGenericAdaptor(RangeT values, const MemberReadOpGenericAdaptorBase &base)
Definition Ops.h.inc:586
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:665
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:758
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::ArrayRef<::mlir::NamedAttribute > attrs)
::mlir::Attribute removeTableOffsetAttr()
Definition Ops.h.inc:764
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:874
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:911
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:688
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:866
MemberReadOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:637
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:889
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:1002
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:712
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:979
::mlir::OpOperand & getComponentMutable()
Definition Ops.h.inc:696
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:692
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1199
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:754
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:829
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member)
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1022
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:1016
::mlir::FlatSymbolRefAttr getMemberNameAttr()
Definition Ops.h.inc:725
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:989
::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:657
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:702
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:645
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:759
inline ::mlir::FailureOr< SymbolLookupResult< MemberDefOp > > getMemberDefOp(::mlir::SymbolTableCollection &tables)
Gets the definition for the member referenced in this op.
Definition Ops.h.inc:798
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:998
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:921
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:740
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:638
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:706
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::Attribute dist, ::mlir::ValueRange mapOperands, std::optional< int32_t > numDims)
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1070
void setTableOffsetAttr(::mlir::Attribute attr)
Definition Ops.h.inc:750
MemberReadOpAdaptor Adaptor
Definition Ops.h.inc:635
void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:745
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:693
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:984
::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:649
::llvm::StringRef getMemberName()
Definition Ops.cpp.inc:974
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:677
::mlir::StringAttr getTableOffsetAttrName()
Definition Ops.h.inc:669
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1076
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:964
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:948
::llvm::LogicalResult verify()
Definition Ops.cpp:784
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:682
::mlir::Attribute getTableOffsetAttr()
Definition Ops.h.inc:730
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:640
void setMemberName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:994
::mlir::StringAttr getMemberNameAttrName()
Definition Ops.h.inc:653
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:740
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1156
::mlir::StringAttr getTableOffsetAttrName(::mlir::OperationName name)
Definition Ops.h.inc:673
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:764
FoldAdaptor::Properties Properties
Definition Ops.h.inc:639
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:735
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:661
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:873
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1224
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:875
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:873
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:877
MemberWriteOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:882
MemberWriteOpGenericAdaptor(RangeT values, const MemberWriteOpGenericAdaptorBase &base)
Definition Ops.h.inc:879
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:884
MemberWriteOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:922
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:923
::mlir::OpOperand & getComponentMutable()
Definition Ops.h.inc:960
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:952
void setMemberName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1320
FoldAdaptor::Properties Properties
Definition Ops.h.inc:924
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1290
inline ::mlir::FailureOr< SymbolLookupResult< MemberDefOp > > getMemberDefOp(::mlir::SymbolTableCollection &tables)
Gets the definition for the member referenced in this op.
Definition Ops.h.inc:1025
::mlir::FlatSymbolRefAttr getMemberNameAttr()
Definition Ops.h.inc:989
::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:934
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1496
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:728
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1394
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1463
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1283
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:925
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1303
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val)
Definition Ops.cpp.inc:1324
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1310
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:938
::llvm::StringRef getMemberName()
Definition Ops.cpp.inc:1315
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1256
void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:994
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:946
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1370
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1277
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:942
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1233
MemberWriteOpAdaptor Adaptor
Definition Ops.h.inc:920
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:970
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:974
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:956
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1294
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1398
::mlir::OpOperand & getValMutable()
Definition Ops.h.inc:965
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1272
::mlir::StringAttr getMemberNameAttrName()
Definition Ops.h.inc:930
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1108
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1521
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:1112
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:1119
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1110
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:1123
StructDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:1117
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1108
StructDefOpGenericAdaptor(RangeT values, const StructDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:1114
::llvm::SmallVector<::mlir::Attribute > getTemplateParamOpNames()
If this struct.def is within a poly.template, return names of all poly.param within the poly....
Definition Ops.cpp:200
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1569
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1574
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:1609
::mlir::LogicalResult hasColumns()
Returns whether the struct defines members marked as columns.
Definition Ops.h.inc:1251
StructType getType(::std::optional<::mlir::ArrayAttr > constParams={}) const
Definition Ops.h.inc:1239
StructType getType(::std::optional<::mlir::ArrayAttr > constParams={})
Gets the StructType representing this struct.
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:1161
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1580
::mlir::Region & getBodyRegion()
Definition Ops.h.inc:1189
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1165
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1587
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1669
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp:490
::llvm::SmallVector<::mlir::Attribute > getTemplateExprOpNames()
If this struct.def is within a poly.template, return names of all poly.expr within the poly....
Definition Ops.cpp:208
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1553
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1600
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:1207
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:1169
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1183
StructDefOpAdaptor Adaptor
Definition Ops.h.inc:1147
::mlir::SymbolRefAttr getFullyQualifiedName()
Return the full name for this struct from the root module, including any surrounding module scopes.
Definition Ops.cpp:216
::std::vector< MemberDefOp > getMemberDefs()
Get all MemberDefOp in this structure.
Definition Ops.cpp:456
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1151
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1173
::llzk::function::FuncDefOp getProductFuncOp()
Gets the FuncDefOp that defines the product function in this structure, if present,...
Definition Ops.cpp:474
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1591
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1673
MemberDefOp getMemberDef(::mlir::StringAttr memberName)
Gets the MemberDefOp that defines the member in this structure with the given name,...
Definition Ops.cpp:445
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp:515
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1530
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:1179
::llzk::function::FuncDefOp getConstrainFuncOp()
Gets the FuncDefOp that defines the constrain function in this structure, if present,...
Definition Ops.cpp:470
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:1202
::mlir::LogicalResult hasSignals()
Returns whether the struct defines members marked as signals.
Definition Ops.h.inc:1258
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1605
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:1150
bool hasTemplateSymbolBindings()
Return true iff the struct.def appears within a poly.template that defines constant parameters and/or...
Definition Ops.cpp:193
::llvm::LogicalResult verifyRegions()
Definition Ops.cpp:322
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1653
::llzk::function::FuncDefOp getComputeFuncOp()
Gets the FuncDefOp that defines the compute function in this structure, if present,...
Definition Ops.cpp:466
bool hasComputeConstrain()
Returns true iff this structure defines compute and constrain functions.
Definition Ops.h.inc:1274
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1157
bool isMainComponent()
Return true iff this struct.def is the main struct. See llzk::MAIN_ATTR_NAME.
Definition Ops.cpp:478
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:1152
StructDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:1149
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1698
::std::string getHeaderString()
Generate header string, in the same format as the assemblyFormat.
Definition Ops.cpp:179
::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
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:237
MemberDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:231
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:227
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:695
MemberReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:538
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:534
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:672
MemberWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:842
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:838
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:848
StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1069
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1065
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:1075
constexpr char FUNC_NAME_COMPUTE[]
Symbol name for the witness generation (and resp.
Definition Constants.h:16
constexpr char FUNC_NAME_CONSTRAIN[]
Definition Constants.h:17
llvm::StringLiteral getOperationName()
Get the operation name, like "constrain.eq" for the given OpClass.
Definition OpHelpers.h:51
void setColumn(const ::mlir::UnitAttr &propValue)
Definition Ops.h.inc:180
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:200
void setSignal(const ::mlir::UnitAttr &propValue)
Definition Ops.h.inc:190
void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:507
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:487
void setTableOffset(const ::mlir::Attribute &propValue)
Definition Ops.h.inc:517
void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:497
void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:824
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:1051