LLZK 3.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:
463 inline bool hasPublicAttr() { return getOperation()->hasAttr(llzk::PublicAttr::name); }
464
466 void setPublicAttr(bool newValue = true);
467};
468} // namespace component
469} // namespace llzk
470MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::MemberDefOp)
471
472namespace llzk {
473namespace component {
474
475//===----------------------------------------------------------------------===//
476// ::llzk::component::MemberReadOp declarations
477//===----------------------------------------------------------------------===//
478
479namespace detail {
481public:
482 struct Properties {
483 using mapOpGroupSizesTy = ::mlir::DenseI32ArrayAttr;
485
487 auto &propStorage = this->mapOpGroupSizes;
488 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
489 }
490 void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue) {
491 this->mapOpGroupSizes = propValue;
492 }
493 using member_nameTy = ::mlir::FlatSymbolRefAttr;
495
497 auto &propStorage = this->member_name;
498 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
499 }
500 void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue) {
501 this->member_name = propValue;
502 }
503 using numDimsPerMapTy = ::mlir::DenseI32ArrayAttr;
505
507 auto &propStorage = this->numDimsPerMap;
508 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
509 }
510 void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue) {
511 this->numDimsPerMap = propValue;
512 }
513 using tableOffsetTy = ::mlir::Attribute;
515
517 auto &propStorage = this->tableOffset;
518 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(propStorage);
519 }
520 void setTableOffset(const ::mlir::Attribute &propValue) {
521 this->tableOffset = propValue;
522 }
523 bool operator==(const Properties &rhs) const {
524 return
525 rhs.mapOpGroupSizes == this->mapOpGroupSizes &&
526 rhs.member_name == this->member_name &&
527 rhs.numDimsPerMap == this->numDimsPerMap &&
528 rhs.tableOffset == this->tableOffset &&
529 true;
530 }
531 bool operator!=(const Properties &rhs) const {
532 return !(*this == rhs);
533 }
534 };
535protected:
536 ::mlir::DictionaryAttr odsAttrs;
537 ::std::optional<::mlir::OperationName> odsOpName;
539 ::mlir::RegionRange odsRegions;
540public:
541 MemberReadOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
542 odsOpName.emplace("struct.readm", odsAttrs.getContext());
543 }
544
546
547 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
549 return properties;
550 }
551
552 ::mlir::DictionaryAttr getAttributes() {
553 return odsAttrs;
554 }
555
556 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
557 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
558 return attr;
559 }
560
561 ::llvm::StringRef getMemberName();
562 ::mlir::Attribute getTableOffsetAttr() {
563 auto attr = ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().tableOffset);
564 return attr;
565 }
566
567 ::std::optional<::mlir::Attribute> getTableOffset();
568 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
569 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
570 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
571 auto attr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
572 return attr;
573 }
574
575 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
576};
577} // namespace detail
578template <typename RangeT>
580 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
582public:
583 MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
584
585 MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : MemberReadOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
586
587 MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MemberReadOpGenericAdaptor(values, attrs, Properties{}, {}) {}
588
589 MemberReadOpGenericAdaptor(RangeT values, const MemberReadOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
590
591 template <typename LateInst = MemberReadOp, typename = std::enable_if_t<std::is_same_v<LateInst, MemberReadOp>>>
592 MemberReadOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
593
594 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
595 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
596 }
597
598 RangeT getODSOperands(unsigned index) {
599 auto valueRange = getODSOperandIndexAndLength(index);
600 return {std::next(odsOperands.begin(), valueRange.first),
601 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
602 }
603
604 ValueT getComponent() {
605 return (*getODSOperands(0).begin());
606 }
607
608 ::llvm::SmallVector<RangeT> getMapOperands() {
609 auto tblgenTmpOperands = getODSOperands(1);
610 auto sizes = getMapOpGroupSizes();
611
612 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
613 for (int i = 0, e = sizes.size(); i < e; ++i) {
614 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
615 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
616 }
617 return tblgenTmpOperandGroups;
618 }
619
620 RangeT getOperands() {
621 return odsOperands;
622 }
623
624private:
625 RangeT odsOperands;
626};
627class MemberReadOpAdaptor : public MemberReadOpGenericAdaptor<::mlir::ValueRange> {
628public:
631
632 ::llvm::LogicalResult verify(::mlir::Location loc);
633};
634class 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, ::mlir::MemoryEffectOpInterface::Trait, ::llzk::component::MemberRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
635public:
636 using Op::Op;
637 using Op::print;
639 template <typename RangeT>
643 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
644 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("mapOpGroupSizes"), ::llvm::StringRef("member_name"), ::llvm::StringRef("numDimsPerMap"), ::llvm::StringRef("tableOffset")};
645 return ::llvm::ArrayRef(attrNames);
646 }
647
648 ::mlir::StringAttr getMapOpGroupSizesAttrName() {
649 return getAttributeNameForIndex(0);
650 }
651
652 static ::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name) {
653 return getAttributeNameForIndex(name, 0);
654 }
655
656 ::mlir::StringAttr getMemberNameAttrName() {
657 return getAttributeNameForIndex(1);
658 }
659
660 static ::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name) {
661 return getAttributeNameForIndex(name, 1);
662 }
663
664 ::mlir::StringAttr getNumDimsPerMapAttrName() {
665 return getAttributeNameForIndex(2);
666 }
667
668 static ::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name) {
669 return getAttributeNameForIndex(name, 2);
670 }
671
672 ::mlir::StringAttr getTableOffsetAttrName() {
673 return getAttributeNameForIndex(3);
674 }
675
676 static ::mlir::StringAttr getTableOffsetAttrName(::mlir::OperationName name) {
677 return getAttributeNameForIndex(name, 3);
678 }
679
680 static constexpr ::llvm::StringLiteral getOperationName() {
681 return ::llvm::StringLiteral("struct.readm");
682 }
683
684 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
685 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
686 auto valueRange = getODSOperandIndexAndLength(index);
687 return {std::next(getOperation()->operand_begin(), valueRange.first),
688 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
689 }
690
691 ::mlir::TypedValue<::llzk::component::StructType> getComponent() {
692 return ::llvm::cast<::mlir::TypedValue<::llzk::component::StructType>>(*getODSOperands(0).begin());
693 }
694
695 ::mlir::OperandRangeRange getMapOperands() {
696 return getODSOperands(1).split(getMapOpGroupSizesAttr());
697 }
698
699 ::mlir::OpOperand &getComponentMutable() {
700 auto range = getODSOperandIndexAndLength(0);
701 return getOperation()->getOpOperand(range.first);
702 }
703
704 ::mlir::MutableOperandRangeRange getMapOperandsMutable();
705 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
706 return {index, 1};
707 }
708
709 ::mlir::Operation::result_range getODSResults(unsigned index) {
710 auto valueRange = getODSResultIndexAndLength(index);
711 return {std::next(getOperation()->result_begin(), valueRange.first),
712 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
713 }
714
715 ::mlir::TypedValue<::mlir::Type> getVal() {
716 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin());
717 }
718
719 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
720 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
721 static llvm::hash_code computePropertiesHash(const Properties &prop);
722 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
723 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
724 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
725 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
726 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
727 void writeProperties(::mlir::DialectBytecodeWriter &writer);
728 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
729 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
730 }
731
732 ::llvm::StringRef getMemberName();
733 ::mlir::Attribute getTableOffsetAttr() {
734 return ::llvm::dyn_cast_or_null<::mlir::Attribute>(getProperties().tableOffset);
735 }
736
737 ::std::optional<::mlir::Attribute> getTableOffset();
738 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr() {
739 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
740 }
741
742 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
743 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
744 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
745 }
746
747 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
748 void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr) {
749 getProperties().member_name = attr;
750 }
751
752 void setMemberName(::llvm::StringRef attrValue);
753 void setTableOffsetAttr(::mlir::Attribute attr) {
754 getProperties().tableOffset = attr;
755 }
756
757 void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr) {
758 getProperties().numDimsPerMap = attr;
759 }
760
761 void setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue);
762 void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr) {
763 getProperties().mapOpGroupSizes = attr;
764 }
765
766 void setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue);
767 ::mlir::Attribute removeTableOffsetAttr() {
768 auto &attr = getProperties().tableOffset;
769 attr = {};
770 return attr;
771 }
772
773 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member);
774 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);
775 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::SymbolRefAttr dist);
776 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type resultType, ::mlir::Value component, ::mlir::StringAttr member, ::mlir::IntegerAttr dist);
777 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::mlir::ArrayRef<::mlir::NamedAttribute> attrs);
778 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
779 ::llvm::LogicalResult verifyInvariantsImpl();
780 ::llvm::LogicalResult verifyInvariants();
781 ::llvm::LogicalResult verify();
782 bool isRead();
783 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
784 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
785 void print(::mlir::OpAsmPrinter &_odsPrinter);
786 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
787private:
788 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
789 return getAttributeNameForIndex((*this)->getName(), index);
790 }
791
792 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
793 assert(index < 4 && "invalid attribute index");
794 assert(name.getStringRef() == getOperationName() && "invalid operation name");
795 assert(name.isRegistered() && "Operation isn't registered, missing a "
796 "dependent dialect loading?");
797 return name.getAttributeNames()[index];
798 }
799
800public:
802 inline ::mlir::FailureOr<SymbolLookupResult<MemberDefOp>> getMemberDefOp(::mlir::SymbolTableCollection &tables) {
803 return ::llvm::cast<MemberRefOpInterface>(getOperation()).getMemberDefOp(tables);
804 }
805};
806} // namespace component
807} // namespace llzk
808MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::MemberReadOp)
809
810namespace llzk {
811namespace component {
812
813//===----------------------------------------------------------------------===//
814// ::llzk::component::MemberWriteOp declarations
815//===----------------------------------------------------------------------===//
816
817namespace detail {
819public:
820 struct Properties {
821 using member_nameTy = ::mlir::FlatSymbolRefAttr;
823
825 auto &propStorage = this->member_name;
826 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(propStorage);
827 }
828 void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue) {
829 this->member_name = propValue;
830 }
831 bool operator==(const Properties &rhs) const {
832 return
833 rhs.member_name == this->member_name &&
834 true;
835 }
836 bool operator!=(const Properties &rhs) const {
837 return !(*this == rhs);
838 }
839 };
840protected:
841 ::mlir::DictionaryAttr odsAttrs;
842 ::std::optional<::mlir::OperationName> odsOpName;
844 ::mlir::RegionRange odsRegions;
845public:
846 MemberWriteOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
847 odsOpName.emplace("struct.writem", odsAttrs.getContext());
848 }
849
851
852 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
853 return {index, 1};
854 }
855
857 return properties;
858 }
859
860 ::mlir::DictionaryAttr getAttributes() {
861 return odsAttrs;
862 }
863
864 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
865 auto attr = ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
866 return attr;
867 }
868
869 ::llvm::StringRef getMemberName();
870};
871} // namespace detail
872template <typename RangeT>
874 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
876public:
877 MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
878
879 MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : MemberWriteOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
880
881 MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MemberWriteOpGenericAdaptor(values, attrs, Properties{}, {}) {}
882
883 MemberWriteOpGenericAdaptor(RangeT values, const MemberWriteOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
884
885 template <typename LateInst = MemberWriteOp, typename = std::enable_if_t<std::is_same_v<LateInst, MemberWriteOp>>>
886 MemberWriteOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
887
888 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
889 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
890 }
891
892 RangeT getODSOperands(unsigned index) {
893 auto valueRange = getODSOperandIndexAndLength(index);
894 return {std::next(odsOperands.begin(), valueRange.first),
895 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
896 }
897
898 ValueT getComponent() {
899 return (*getODSOperands(0).begin());
900 }
901
902 ValueT getVal() {
903 return (*getODSOperands(1).begin());
904 }
905
906 RangeT getOperands() {
907 return odsOperands;
908 }
909
910private:
911 RangeT odsOperands;
912};
913class MemberWriteOpAdaptor : public MemberWriteOpGenericAdaptor<::mlir::ValueRange> {
914public:
917
918 ::llvm::LogicalResult verify(::mlir::Location loc);
919};
920class 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, ::mlir::MemoryEffectOpInterface::Trait, ::llzk::component::MemberRefOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
921public:
922 using Op::Op;
923 using Op::print;
925 template <typename RangeT>
929 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
930 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("member_name")};
931 return ::llvm::ArrayRef(attrNames);
932 }
933
934 ::mlir::StringAttr getMemberNameAttrName() {
935 return getAttributeNameForIndex(0);
936 }
937
938 static ::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name) {
939 return getAttributeNameForIndex(name, 0);
940 }
941
942 static constexpr ::llvm::StringLiteral getOperationName() {
943 return ::llvm::StringLiteral("struct.writem");
944 }
945
946 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
947 return {index, 1};
948 }
949
950 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
951 auto valueRange = getODSOperandIndexAndLength(index);
952 return {std::next(getOperation()->operand_begin(), valueRange.first),
953 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
954 }
955
956 ::mlir::TypedValue<::llzk::component::StructType> getComponent() {
957 return ::llvm::cast<::mlir::TypedValue<::llzk::component::StructType>>(*getODSOperands(0).begin());
958 }
959
960 ::mlir::TypedValue<::mlir::Type> getVal() {
961 return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(1).begin());
962 }
963
964 ::mlir::OpOperand &getComponentMutable() {
965 auto range = getODSOperandIndexAndLength(0);
966 return getOperation()->getOpOperand(range.first);
967 }
968
969 ::mlir::OpOperand &getValMutable() {
970 auto range = getODSOperandIndexAndLength(1);
971 return getOperation()->getOpOperand(range.first);
972 }
973
974 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
975 return {index, 1};
976 }
977
978 ::mlir::Operation::result_range getODSResults(unsigned index) {
979 auto valueRange = getODSResultIndexAndLength(index);
980 return {std::next(getOperation()->result_begin(), valueRange.first),
981 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
982 }
983
984 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
985 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
986 static llvm::hash_code computePropertiesHash(const Properties &prop);
987 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
988 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
989 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
990 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
991 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
992 void writeProperties(::mlir::DialectBytecodeWriter &writer);
993 ::mlir::FlatSymbolRefAttr getMemberNameAttr() {
994 return ::llvm::cast<::mlir::FlatSymbolRefAttr>(getProperties().member_name);
995 }
996
997 ::llvm::StringRef getMemberName();
998 void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr) {
999 getProperties().member_name = attr;
1000 }
1001
1002 void setMemberName(::llvm::StringRef attrValue);
1003 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val);
1004 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val);
1005 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::llvm::StringRef member_name, ::mlir::Value val);
1006 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value component, ::llvm::StringRef member_name, ::mlir::Value val);
1007 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1008 ::llvm::LogicalResult verifyInvariantsImpl();
1009 ::llvm::LogicalResult verifyInvariants();
1010 bool isRead();
1011 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
1012 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
1013 void print(::mlir::OpAsmPrinter &_odsPrinter);
1014 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
1015private:
1016 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
1017 return getAttributeNameForIndex((*this)->getName(), index);
1018 }
1019
1020 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
1021 assert(index < 1 && "invalid attribute index");
1022 assert(name.getStringRef() == getOperationName() && "invalid operation name");
1023 assert(name.isRegistered() && "Operation isn't registered, missing a "
1024 "dependent dialect loading?");
1025 return name.getAttributeNames()[index];
1026 }
1027
1028public:
1030 inline ::mlir::FailureOr<SymbolLookupResult<MemberDefOp>> getMemberDefOp(::mlir::SymbolTableCollection &tables) {
1031 return ::llvm::cast<MemberRefOpInterface>(getOperation()).getMemberDefOp(tables);
1032 }
1033};
1034} // namespace component
1035} // namespace llzk
1036MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::MemberWriteOp)
1037
1038namespace llzk {
1039namespace component {
1040
1041//===----------------------------------------------------------------------===//
1042// ::llzk::component::StructDefOp declarations
1043//===----------------------------------------------------------------------===//
1044
1045namespace detail {
1047public:
1048 struct Properties {
1049 using sym_nameTy = ::mlir::StringAttr;
1051
1052 auto getSymName() {
1053 auto &propStorage = this->sym_name;
1054 return ::llvm::cast<::mlir::StringAttr>(propStorage);
1055 }
1056 void setSymName(const ::mlir::StringAttr &propValue) {
1057 this->sym_name = propValue;
1058 }
1059 bool operator==(const Properties &rhs) const {
1060 return
1061 rhs.sym_name == this->sym_name &&
1062 true;
1063 }
1064 bool operator!=(const Properties &rhs) const {
1065 return !(*this == rhs);
1066 }
1067 };
1068protected:
1069 ::mlir::DictionaryAttr odsAttrs;
1070 ::std::optional<::mlir::OperationName> odsOpName;
1072 ::mlir::RegionRange odsRegions;
1073public:
1074 StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
1075 odsOpName.emplace("struct.def", odsAttrs.getContext());
1076 }
1077
1079
1080 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
1081 return {index, 1};
1082 }
1083
1085 return properties;
1086 }
1087
1088 ::mlir::DictionaryAttr getAttributes() {
1089 return odsAttrs;
1090 }
1091
1092 ::mlir::StringAttr getSymNameAttr() {
1093 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
1094 return attr;
1095 }
1096
1097 ::llvm::StringRef getSymName();
1098 ::mlir::Region &getBodyRegion() {
1099 return *odsRegions[0];
1100 }
1101
1102 ::mlir::RegionRange getRegions() {
1103 return odsRegions;
1104 }
1105
1106};
1107} // namespace detail
1108template <typename RangeT>
1110 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
1112public:
1113 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
1114
1115 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : StructDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
1116
1117 StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : StructDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
1118
1119 StructDefOpGenericAdaptor(RangeT values, const StructDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
1120
1121 template <typename LateInst = StructDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, StructDefOp>>>
1122 StructDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
1123
1124 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
1125 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
1126 }
1127
1128 RangeT getODSOperands(unsigned index) {
1129 auto valueRange = getODSOperandIndexAndLength(index);
1130 return {std::next(odsOperands.begin(), valueRange.first),
1131 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
1132 }
1133
1134 RangeT getOperands() {
1135 return odsOperands;
1136 }
1137
1138private:
1139 RangeT odsOperands;
1140};
1141class StructDefOpAdaptor : public StructDefOpGenericAdaptor<::mlir::ValueRange> {
1142public:
1145
1146 ::llvm::LogicalResult verify(::mlir::Location loc);
1147};
1148class 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, ::llzk::verif::ContractTargetOpInterface::Trait, ::mlir::RegionKindInterface::Trait, ::mlir::OpTrait::HasOnlyGraphRegion> {
1149public:
1150 using Op::Op;
1151 using Op::print;
1153 template <typename RangeT>
1157 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
1158 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("sym_name")};
1159 return ::llvm::ArrayRef(attrNames);
1160 }
1161
1162 ::mlir::StringAttr getSymNameAttrName() {
1163 return getAttributeNameForIndex(0);
1164 }
1165
1166 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
1167 return getAttributeNameForIndex(name, 0);
1168 }
1169
1170 static constexpr ::llvm::StringLiteral getOperationName() {
1171 return ::llvm::StringLiteral("struct.def");
1172 }
1173
1174 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
1175 return {index, 1};
1176 }
1177
1178 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
1179 auto valueRange = getODSOperandIndexAndLength(index);
1180 return {std::next(getOperation()->operand_begin(), valueRange.first),
1181 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1182 }
1183
1184 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
1185 return {index, 1};
1186 }
1187
1188 ::mlir::Operation::result_range getODSResults(unsigned index) {
1189 auto valueRange = getODSResultIndexAndLength(index);
1190 return {std::next(getOperation()->result_begin(), valueRange.first),
1191 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1192 }
1193
1194 ::mlir::Region &getBodyRegion() {
1195 return (*this)->getRegion(0);
1196 }
1197
1198 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1199 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
1200 static llvm::hash_code computePropertiesHash(const Properties &prop);
1201 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
1202 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
1203 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
1204 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1205 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
1206 void writeProperties(::mlir::DialectBytecodeWriter &writer);
1207 ::mlir::StringAttr getSymNameAttr() {
1208 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
1209 }
1210
1211 ::llvm::StringRef getSymName();
1212 void setSymNameAttr(::mlir::StringAttr attr) {
1213 getProperties().sym_name = attr;
1214 }
1215
1216 void setSymName(::llvm::StringRef attrValue);
1217 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name);
1218 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name);
1219 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name);
1220 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name);
1221 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1222 ::llvm::LogicalResult verifyInvariantsImpl();
1223 ::llvm::LogicalResult verifyInvariants();
1224 ::llvm::LogicalResult verifyRegions();
1225 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
1226 void print(::mlir::OpAsmPrinter &_odsPrinter);
1227private:
1228 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
1229 return getAttributeNameForIndex((*this)->getName(), index);
1230 }
1231
1232 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
1233 assert(index < 1 && "invalid attribute index");
1234 assert(name.getStringRef() == getOperationName() && "invalid operation name");
1235 assert(name.isRegistered() && "Operation isn't registered, missing a "
1236 "dependent dialect loading?");
1237 return name.getAttributeNames()[index];
1238 }
1239
1240public:
1243 StructType getType(::std::optional<::mlir::ArrayAttr> constParams = {});
1244 inline StructType getType(::std::optional<::mlir::ArrayAttr> constParams = {}) const {
1245 return const_cast<StructDefOp*>(this)->getType(constParams);
1246 }
1247
1250 MemberDefOp getMemberDef(::mlir::StringAttr memberName);
1251
1253 ::std::vector<MemberDefOp> getMemberDefs();
1254
1256 ::mlir::LogicalResult hasColumns() {
1257 return ::mlir::success(::llvm::any_of(getMemberDefs(), [](MemberDefOp memberOp) {
1258 return memberOp.getColumn();
1259 }));
1260 }
1261
1263 ::mlir::LogicalResult hasSignals() {
1264 return ::mlir::success(::llvm::any_of(getMemberDefs(), [](MemberDefOp memberOp) {
1265 return memberOp.getSignal();
1266 }));
1267 }
1268
1271
1274
1277
1279 bool hasComputeConstrain() { return lookupSymbol(FUNC_NAME_COMPUTE) != nullptr && lookupSymbol(FUNC_NAME_CONSTRAIN) != nullptr; }
1280
1282 ::std::string getHeaderString();
1283
1287
1292 ::llvm::SmallVector<::mlir::Attribute> getTemplateParamOpNames();
1293
1298 ::llvm::SmallVector<::mlir::Attribute> getTemplateExprOpNames();
1299
1302 ::mlir::SymbolRefAttr getFullyQualifiedName();
1303
1305 bool isMainComponent();
1306};
1307} // namespace component
1308} // namespace llzk
1309MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::component::StructDefOp)
1310
1311
1312#endif // GET_OP_CLASSES
1313
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:814
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:202
void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn)
Definition Ops.cpp:810
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
bool hasPublicAttr()
Returns whether this member is a public output.
Definition Ops.h.inc:463
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)
Adds or removes the unit llzk.pub attribute according to newValue.
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:583
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:718
MemberReadOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:592
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:594
::llvm::SmallVector< RangeT > getMapOperands()
Definition Ops.h.inc:608
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:583
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:598
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:585
MemberReadOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:587
MemberReadOpGenericAdaptor(RangeT values, const MemberReadOpGenericAdaptorBase &base)
Definition Ops.h.inc:589
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:668
::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:767
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:691
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:866
MemberReadOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:640
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:715
::std::optional<::mlir::Attribute > getTableOffset()
Definition Ops.cpp.inc:979
::mlir::OpOperand & getComponentMutable()
Definition Ops.h.inc:699
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:695
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1203
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:757
::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:728
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:989
::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:660
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:705
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:648
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:762
inline ::mlir::FailureOr< SymbolLookupResult< MemberDefOp > > getMemberDefOp(::mlir::SymbolTableCollection &tables)
Gets the definition for the member referenced in this op.
Definition Ops.h.inc:802
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:641
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:709
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:753
MemberReadOpAdaptor Adaptor
Definition Ops.h.inc:638
void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:748
::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:652
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1198
::llvm::StringRef getMemberName()
Definition Ops.cpp.inc:974
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:680
::mlir::StringAttr getTableOffsetAttrName()
Definition Ops.h.inc:672
::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:795
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:685
::mlir::Attribute getTableOffsetAttr()
Definition Ops.h.inc:733
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:643
void setMemberName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:994
::mlir::StringAttr getMemberNameAttrName()
Definition Ops.h.inc:656
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:743
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1156
::mlir::StringAttr getTableOffsetAttrName(::mlir::OperationName name)
Definition Ops.h.inc:676
::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:642
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:738
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:664
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:877
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1228
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:879
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:877
MemberWriteOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:881
MemberWriteOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:886
MemberWriteOpGenericAdaptor(RangeT values, const MemberWriteOpGenericAdaptorBase &base)
Definition Ops.h.inc:883
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:888
MemberWriteOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:926
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1499
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:927
::mlir::OpOperand & getComponentMutable()
Definition Ops.h.inc:964
::mlir::TypedValue<::llzk::component::StructType > getComponent()
Definition Ops.h.inc:956
void setMemberName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1324
FoldAdaptor::Properties Properties
Definition Ops.h.inc:928
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1294
inline ::mlir::FailureOr< SymbolLookupResult< MemberDefOp > > getMemberDefOp(::mlir::SymbolTableCollection &tables)
Gets the definition for the member referenced in this op.
Definition Ops.h.inc:1030
::mlir::FlatSymbolRefAttr getMemberNameAttr()
Definition Ops.h.inc:993
::mlir::StringAttr getMemberNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:938
bool isRead()
Return true if the op is a read, false if it's a write.
Definition Ops.cpp.inc:1504
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:739
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1398
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1467
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1287
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:929
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1307
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value component, ::mlir::FlatSymbolRefAttr member_name, ::mlir::Value val)
Definition Ops.cpp.inc:1328
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1314
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:942
::llvm::StringRef getMemberName()
Definition Ops.cpp.inc:1319
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1260
void setMemberNameAttr(::mlir::FlatSymbolRefAttr attr)
Definition Ops.h.inc:998
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:950
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1374
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1281
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:946
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1237
MemberWriteOpAdaptor Adaptor
Definition Ops.h.inc:924
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:974
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:978
::mlir::TypedValue<::mlir::Type > getVal()
Definition Ops.h.inc:960
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1298
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1402
::mlir::OpOperand & getValMutable()
Definition Ops.h.inc:969
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1276
::mlir::StringAttr getMemberNameAttrName()
Definition Ops.h.inc:934
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1113
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1529
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:1117
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:1124
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1115
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:1128
StructDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:1122
StructDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1113
StructDefOpGenericAdaptor(RangeT values, const StructDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:1119
::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:204
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1577
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1582
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name)
Definition Ops.cpp.inc:1617
::mlir::LogicalResult hasColumns()
Returns whether the struct defines members marked as columns.
Definition Ops.h.inc:1256
StructType getType(::std::optional<::mlir::ArrayAttr > constParams={}) const
Definition Ops.h.inc:1244
StructType getType(::std::optional<::mlir::ArrayAttr > constParams={})
Gets the StructType representing this struct.
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:1166
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1588
::mlir::Region & getBodyRegion()
Definition Ops.h.inc:1194
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1170
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1595
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1677
::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:212
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1561
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1608
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:1212
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:1174
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1188
StructDefOpAdaptor Adaptor
Definition Ops.h.inc:1152
::mlir::SymbolRefAttr getFullyQualifiedName()
Return the full name for this struct from the root module, including any surrounding module scopes.
Definition Ops.cpp:220
::std::vector< MemberDefOp > getMemberDefs()
Get all MemberDefOp in this structure.
Definition Ops.cpp:456
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1156
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1178
::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:1599
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1681
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:1538
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:1184
::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:1207
::mlir::LogicalResult hasSignals()
Returns whether the struct defines members marked as signals.
Definition Ops.h.inc:1263
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1613
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:1155
bool hasTemplateSymbolBindings()
Return true iff the struct.def appears within a poly.template that defines constant parameters and/or...
Definition Ops.cpp:197
::llvm::LogicalResult verifyRegions()
Definition Ops.cpp:322
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1661
::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:1279
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:1162
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:1157
StructDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:1154
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1706
::std::string getHeaderString()
Generate header string, in the same format as the assemblyFormat.
Definition Ops.cpp:183
::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:541
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:537
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:846
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:842
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:852
StructDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1074
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1070
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:1080
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:32
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:510
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:490
void setTableOffset(const ::mlir::Attribute &propValue)
Definition Ops.h.inc:520
void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:500
void setMemberName(const ::mlir::FlatSymbolRefAttr &propValue)
Definition Ops.h.inc:828
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:1056