LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
Ops.h.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op Declarations *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10namespace llzk {
11namespace function {
12class CallOp;
13} // namespace function
14} // namespace llzk
15namespace llzk {
16namespace function {
17class FuncDefOp;
18} // namespace function
19} // namespace llzk
20namespace llzk {
21namespace function {
22class ReturnOp;
23} // namespace function
24} // namespace llzk
25#ifdef GET_OP_CLASSES
26#undef GET_OP_CLASSES
27
28namespace llzk {
29namespace function {
30
31//===----------------------------------------------------------------------===//
32// ::llzk::function::CallOp declarations
33//===----------------------------------------------------------------------===//
34
35namespace detail {
37public:
38 struct Properties {
39 using calleeTy = ::mlir::SymbolRefAttr;
41
42 auto getCallee() {
43 auto &propStorage = this->callee;
44 return ::llvm::cast<::mlir::SymbolRefAttr>(propStorage);
45 }
46 void setCallee(const ::mlir::SymbolRefAttr &propValue) {
47 this->callee = propValue;
48 }
49 using mapOpGroupSizesTy = ::mlir::DenseI32ArrayAttr;
51
53 auto &propStorage = this->mapOpGroupSizes;
54 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
55 }
56 void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue) {
57 this->mapOpGroupSizes = propValue;
58 }
59 using numDimsPerMapTy = ::mlir::DenseI32ArrayAttr;
61
63 auto &propStorage = this->numDimsPerMap;
64 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
65 }
66 void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue) {
67 this->numDimsPerMap = propValue;
68 }
69 using operandSegmentSizesTy = std::array<int32_t, 2>;
71 ::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
72 auto &propStorage = this->operandSegmentSizes;
73 return propStorage;
74 }
75 void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
76 auto &propStorage = this->operandSegmentSizes;
77 ::llvm::copy(propValue, propStorage.begin());
78 }
79 bool operator==(const Properties &rhs) const {
80 return
81 rhs.callee == this->callee &&
82 rhs.mapOpGroupSizes == this->mapOpGroupSizes &&
83 rhs.numDimsPerMap == this->numDimsPerMap &&
84 rhs.operandSegmentSizes == this->operandSegmentSizes &&
85 true;
86 }
87 bool operator!=(const Properties &rhs) const {
88 return !(*this == rhs);
89 }
90 };
91protected:
92 ::mlir::DictionaryAttr odsAttrs;
93 ::std::optional<::mlir::OperationName> odsOpName;
95 ::mlir::RegionRange odsRegions;
96public:
97 CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
98 odsOpName.emplace("function.call", odsAttrs.getContext());
99 }
100
102
103 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
105 return properties;
106 }
107
108 ::mlir::DictionaryAttr getAttributes() {
109 return odsAttrs;
110 }
111
112 ::mlir::SymbolRefAttr getCalleeAttr() {
113 auto attr = ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().callee);
114 return attr;
115 }
116
117 ::mlir::SymbolRefAttr getCallee();
118 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
119 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
120 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
121 auto attr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
122 return attr;
123 }
124
125 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
126};
127} // namespace detail
128template <typename RangeT>
130 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
132public:
133 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
134
135 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : CallOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
136
137 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : CallOpGenericAdaptor(values, attrs, Properties{}, {}) {}
138
139 CallOpGenericAdaptor(RangeT values, const CallOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
140
141 template <typename LateInst = CallOp, typename = std::enable_if_t<std::is_same_v<LateInst, CallOp>>>
142 CallOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
143
144 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
145 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
146 }
147
148 RangeT getODSOperands(unsigned index) {
149 auto valueRange = getODSOperandIndexAndLength(index);
150 return {std::next(odsOperands.begin(), valueRange.first),
151 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
152 }
153
154 RangeT getArgOperands() {
155 return getODSOperands(0);
156 }
157
158 ::llvm::SmallVector<RangeT> getMapOperands() {
159 auto tblgenTmpOperands = getODSOperands(1);
160 auto sizes = getMapOpGroupSizes();
161
162 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
163 for (int i = 0, e = sizes.size(); i < e; ++i) {
164 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
165 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
166 }
167 return tblgenTmpOperandGroups;
168 }
169
170 RangeT getOperands() {
171 return odsOperands;
172 }
173
174private:
175 RangeT odsOperands;
176};
177class CallOpAdaptor : public CallOpGenericAdaptor<::mlir::ValueRange> {
178public:
181
182 ::llvm::LogicalResult verify(::mlir::Location loc);
183};
184class CallOp : public ::mlir::Op<CallOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::VariadicResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::AttrSizedOperandSegments, ::llzk::VerifySizesForMultiAffineOps<1>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::MemRefsNormalizable, ::mlir::CallOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait> {
185public:
186 using Op::Op;
187 using Op::print;
189 template <typename RangeT>
193 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
194 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("callee"), ::llvm::StringRef("mapOpGroupSizes"), ::llvm::StringRef("numDimsPerMap"), ::llvm::StringRef("operandSegmentSizes")};
195 return ::llvm::ArrayRef(attrNames);
196 }
197
198 ::mlir::StringAttr getCalleeAttrName() {
199 return getAttributeNameForIndex(0);
200 }
201
202 static ::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name) {
203 return getAttributeNameForIndex(name, 0);
204 }
205
206 ::mlir::StringAttr getMapOpGroupSizesAttrName() {
207 return getAttributeNameForIndex(1);
208 }
209
210 static ::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name) {
211 return getAttributeNameForIndex(name, 1);
212 }
213
214 ::mlir::StringAttr getNumDimsPerMapAttrName() {
215 return getAttributeNameForIndex(2);
216 }
217
218 static ::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name) {
219 return getAttributeNameForIndex(name, 2);
220 }
221
222 ::mlir::StringAttr getOperandSegmentSizesAttrName() {
223 return (*this)->getName().getAttributeNames().back();
224 }
225
226 static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
227 return name.getAttributeNames().back();
228 }
229
230 static constexpr ::llvm::StringLiteral getOperationName() {
231 return ::llvm::StringLiteral("function.call");
232 }
233
234 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
235 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
236 auto valueRange = getODSOperandIndexAndLength(index);
237 return {std::next(getOperation()->operand_begin(), valueRange.first),
238 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
239 }
240
241 ::mlir::Operation::operand_range getArgOperands() {
242 return getODSOperands(0);
243 }
244
245 ::mlir::OperandRangeRange getMapOperands() {
246 return getODSOperands(1).split(getMapOpGroupSizesAttr());
247 }
248
249 ::mlir::MutableOperandRange getArgOperandsMutable();
250 ::mlir::MutableOperandRangeRange getMapOperandsMutable();
251 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
252 ::mlir::Operation::result_range getODSResults(unsigned index) {
253 auto valueRange = getODSResultIndexAndLength(index);
254 return {std::next(getOperation()->result_begin(), valueRange.first),
255 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
256 }
257
258 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
259 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
260 static llvm::hash_code computePropertiesHash(const Properties &prop);
261 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
262 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
263 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
264 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
265 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
266 void writeProperties(::mlir::DialectBytecodeWriter &writer);
267 ::mlir::SymbolRefAttr getCalleeAttr() {
268 return ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().callee);
269 }
270
271 ::mlir::SymbolRefAttr getCallee();
272 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr() {
273 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
274 }
275
276 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
277 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
278 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
279 }
280
281 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
282 void setCalleeAttr(::mlir::SymbolRefAttr attr) {
283 getProperties().callee = attr;
284 }
285
286 void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr) {
287 getProperties().numDimsPerMap = attr;
288 }
289
290 void setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue);
291 void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr) {
292 getProperties().mapOpGroupSizes = attr;
293 }
294
295 void setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue);
296 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands = {});
297 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {});
298 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {});
299 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands = {});
300 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {});
301 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {});
302 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
303 ::llvm::LogicalResult verifyInvariantsImpl();
304 ::llvm::LogicalResult verifyInvariants();
305 ::mlir::CallInterfaceCallable getCallableForCallee();
306 void setCalleeFromCallable(::mlir::CallInterfaceCallable callee);
307 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
308 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
309 static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
310 void print(::mlir::OpAsmPrinter &_odsPrinter);
311private:
312 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
313 return getAttributeNameForIndex((*this)->getName(), index);
314 }
315
316 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
317 assert(index < 3 && "invalid attribute index");
318 assert(name.getStringRef() == getOperationName() && "invalid operation name");
319 assert(name.isRegistered() && "Operation isn't registered, missing a "
320 "dependent dialect loading?");
321 return name.getAttributeNames()[index];
322 }
323
324public:
325 ::mlir::FunctionType getCalleeType();
326
329 inline bool calleeIsCompute() {
330 return FUNC_NAME_COMPUTE == getCallee().getLeafReference();
331 }
332
336 return FUNC_NAME_COMPUTE == getCallee().getLeafReference() ||
337 FUNC_NAME_PRODUCT == getCallee().getLeafReference();
338 }
339
342 inline bool calleeIsConstrain() { return FUNC_NAME_CONSTRAIN == getCallee().getLeafReference(); }
343
346
349
352 ::mlir::Value getSelfValueFromCompute();
353
356 ::mlir::Value getSelfValueFromConstrain();
357
359 ::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp>>
360 getCalleeTarget(::mlir::SymbolTableCollection &tables);
361
364
367
370 static ::llvm::SmallVector<::mlir::ValueRange> toVectorOfValueRange(::mlir::OperandRangeRange);
371};
372} // namespace function
373} // namespace llzk
374MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::CallOp)
375
376namespace llzk {
377namespace function {
378
379//===----------------------------------------------------------------------===//
380// ::llzk::function::FuncDefOp declarations
381//===----------------------------------------------------------------------===//
382
383namespace detail {
385public:
386 struct Properties {
387 using arg_attrsTy = ::mlir::ArrayAttr;
389
390 auto getArgAttrs() {
391 auto &propStorage = this->arg_attrs;
392 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
393 }
394 void setArgAttrs(const ::mlir::ArrayAttr &propValue) {
395 this->arg_attrs = propValue;
396 }
397 using function_typeTy = ::mlir::TypeAttr;
399
401 auto &propStorage = this->function_type;
402 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
403 }
404 void setFunctionType(const ::mlir::TypeAttr &propValue) {
405 this->function_type = propValue;
406 }
407 using res_attrsTy = ::mlir::ArrayAttr;
409
410 auto getResAttrs() {
411 auto &propStorage = this->res_attrs;
412 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
413 }
414 void setResAttrs(const ::mlir::ArrayAttr &propValue) {
415 this->res_attrs = propValue;
416 }
417 using sym_nameTy = ::mlir::StringAttr;
419
420 auto getSymName() {
421 auto &propStorage = this->sym_name;
422 return ::llvm::cast<::mlir::StringAttr>(propStorage);
423 }
424 void setSymName(const ::mlir::StringAttr &propValue) {
425 this->sym_name = propValue;
426 }
427 bool operator==(const Properties &rhs) const {
428 return
429 rhs.arg_attrs == this->arg_attrs &&
430 rhs.function_type == this->function_type &&
431 rhs.res_attrs == this->res_attrs &&
432 rhs.sym_name == this->sym_name &&
433 true;
434 }
435 bool operator!=(const Properties &rhs) const {
436 return !(*this == rhs);
437 }
438 };
439protected:
440 ::mlir::DictionaryAttr odsAttrs;
441 ::std::optional<::mlir::OperationName> odsOpName;
443 ::mlir::RegionRange odsRegions;
444public:
445 FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
446 odsOpName.emplace("function.def", odsAttrs.getContext());
447 }
448
450
451 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
452 return {index, 1};
453 }
454
456 return properties;
457 }
458
459 ::mlir::DictionaryAttr getAttributes() {
460 return odsAttrs;
461 }
462
463 ::mlir::StringAttr getSymNameAttr() {
464 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
465 return attr;
466 }
467
468 ::llvm::StringRef getSymName();
469 ::mlir::TypeAttr getFunctionTypeAttr() {
470 auto attr = ::llvm::cast<::mlir::TypeAttr>(getProperties().function_type);
471 return attr;
472 }
473
474 ::mlir::FunctionType getFunctionType();
475 ::mlir::ArrayAttr getArgAttrsAttr() {
476 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().arg_attrs);
477 return attr;
478 }
479
480 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
481 ::mlir::ArrayAttr getResAttrsAttr() {
482 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().res_attrs);
483 return attr;
484 }
485
486 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
487 ::mlir::Region &getBody() {
488 return *odsRegions[0];
489 }
490
491 ::mlir::RegionRange getRegions() {
492 return odsRegions;
493 }
494
495};
496} // namespace detail
497template <typename RangeT>
499 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
501public:
502 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
503
504 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FuncDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
505
506 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FuncDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
507
508 FuncDefOpGenericAdaptor(RangeT values, const FuncDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
509
510 template <typename LateInst = FuncDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, FuncDefOp>>>
511 FuncDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
512
513 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
514 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
515 }
516
517 RangeT getODSOperands(unsigned index) {
518 auto valueRange = getODSOperandIndexAndLength(index);
519 return {std::next(odsOperands.begin(), valueRange.first),
520 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
521 }
522
523 RangeT getOperands() {
524 return odsOperands;
525 }
526
527private:
528 RangeT odsOperands;
529};
530class FuncDefOpAdaptor : public FuncDefOpGenericAdaptor<::mlir::ValueRange> {
531public:
534
535 ::llvm::LogicalResult verify(::mlir::Location loc);
536};
537class FuncDefOp : public ::mlir::Op<FuncDefOp, ::mlir::OpTrait::OneRegion, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::HasParent<::mlir::ModuleOp, ::llzk::component::StructDefOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait, ::mlir::OpTrait::AffineScope, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::SymbolOpInterface::Trait, ::mlir::CallableOpInterface::Trait, ::mlir::FunctionOpInterface::Trait, ::mlir::OpTrait::IsIsolatedFromAbove> {
538public:
539 using Op::Op;
540 using Op::print;
542 template <typename RangeT>
546 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
547 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("arg_attrs"), ::llvm::StringRef("function_type"), ::llvm::StringRef("res_attrs"), ::llvm::StringRef("sym_name")};
548 return ::llvm::ArrayRef(attrNames);
549 }
550
551 ::mlir::StringAttr getArgAttrsAttrName() {
552 return getAttributeNameForIndex(0);
553 }
554
555 static ::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name) {
556 return getAttributeNameForIndex(name, 0);
557 }
558
559 ::mlir::StringAttr getFunctionTypeAttrName() {
560 return getAttributeNameForIndex(1);
561 }
562
563 static ::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name) {
564 return getAttributeNameForIndex(name, 1);
565 }
566
567 ::mlir::StringAttr getResAttrsAttrName() {
568 return getAttributeNameForIndex(2);
569 }
570
571 static ::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name) {
572 return getAttributeNameForIndex(name, 2);
573 }
574
575 ::mlir::StringAttr getSymNameAttrName() {
576 return getAttributeNameForIndex(3);
577 }
578
579 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
580 return getAttributeNameForIndex(name, 3);
581 }
582
583 static constexpr ::llvm::StringLiteral getOperationName() {
584 return ::llvm::StringLiteral("function.def");
585 }
586
587 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
588 return {index, 1};
589 }
590
591 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
592 auto valueRange = getODSOperandIndexAndLength(index);
593 return {std::next(getOperation()->operand_begin(), valueRange.first),
594 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
595 }
596
597 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
598 return {index, 1};
599 }
600
601 ::mlir::Operation::result_range getODSResults(unsigned index) {
602 auto valueRange = getODSResultIndexAndLength(index);
603 return {std::next(getOperation()->result_begin(), valueRange.first),
604 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
605 }
606
607 ::mlir::Region &getBody() {
608 return (*this)->getRegion(0);
609 }
610
611 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
612 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
613 static llvm::hash_code computePropertiesHash(const Properties &prop);
614 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
615 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
616 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
617 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
618 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
619 void writeProperties(::mlir::DialectBytecodeWriter &writer);
620 ::mlir::StringAttr getSymNameAttr() {
621 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
622 }
623
624 ::llvm::StringRef getSymName();
625 ::mlir::TypeAttr getFunctionTypeAttr() {
626 return ::llvm::cast<::mlir::TypeAttr>(getProperties().function_type);
627 }
628
629 ::mlir::FunctionType getFunctionType();
630 ::mlir::ArrayAttr getArgAttrsAttr() {
631 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().arg_attrs);
632 }
633
634 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
635 ::mlir::ArrayAttr getResAttrsAttr() {
636 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().res_attrs);
637 }
638
639 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
640 void setSymNameAttr(::mlir::StringAttr attr) {
641 getProperties().sym_name = attr;
642 }
643
644 void setSymName(::llvm::StringRef attrValue);
645 void setFunctionTypeAttr(::mlir::TypeAttr attr) {
646 getProperties().function_type = attr;
647 }
648
649 void setFunctionType(::mlir::FunctionType attrValue);
650 void setArgAttrsAttr(::mlir::ArrayAttr attr) {
651 getProperties().arg_attrs = attr;
652 }
653
654 void setResAttrsAttr(::mlir::ArrayAttr attr) {
655 getProperties().res_attrs = attr;
656 }
657
658 ::mlir::Attribute removeArgAttrsAttr() {
659 auto &attr = getProperties().arg_attrs;
660 attr = {};
661 return attr;
662 }
663
664 ::mlir::Attribute removeResAttrsAttr() {
665 auto &attr = getProperties().res_attrs;
666 attr = {};
667 return attr;
668 }
669
670 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {}, ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs = {});
671 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
672 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
673 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
674 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
675 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
676 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
677 void print(::mlir::OpAsmPrinter &p);
678 ::llvm::LogicalResult verifyInvariantsImpl();
679 ::llvm::LogicalResult verifyInvariants();
680 ::llvm::LogicalResult verify();
681 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
682private:
683 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
684 return getAttributeNameForIndex((*this)->getName(), index);
685 }
686
687 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
688 assert(index < 4 && "invalid attribute index");
689 assert(name.getStringRef() == getOperationName() && "invalid operation name");
690 assert(name.isRegistered() && "Operation isn't registered, missing a "
691 "dependent dialect loading?");
692 return name.getAttributeNames()[index];
693 }
694
695public:
696 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
697 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {});
698 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
699 ::mlir::Operation::dialect_attr_range attrs);
700 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
701 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs,
702 ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs);
703
711 FuncDefOp clone(::mlir::IRMapping &mapper);
713
718 void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper);
719
722 return getOperation()->hasAttr(llzk::function::AllowConstraintAttr::name);
723 }
724
726 void setAllowConstraintAttr(bool newValue = true);
727
729 inline bool hasAllowWitnessAttr() {
730 return getOperation()->hasAttr(llzk::function::AllowWitnessAttr::name);
731 }
732
734 void setAllowWitnessAttr(bool newValue = true);
735
737 bool hasArgPublicAttr(unsigned index);
738
739 //===------------------------------------------------------------------===//
740 // FunctionOpInterface Methods
741 //===------------------------------------------------------------------===//
742
746 ::mlir::Region *getCallableRegion() { return isExternal() ? nullptr : &getBody(); }
747
749 ::llvm::ArrayRef<::mlir::Type> getArgumentTypes() { return getFunctionType().getInputs(); }
750
752 ::llvm::ArrayRef<::mlir::Type> getResultTypes() { return getFunctionType().getResults(); }
753
754 //===------------------------------------------------------------------===//
755 // SymbolOpInterface Methods
756 //===------------------------------------------------------------------===//
757
758 bool isDeclaration() { return isExternal(); }
759
760 //===------------------------------------------------------------------===//
761 // Utility Methods
762 //===------------------------------------------------------------------===//
763
766 ::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent = true);
767
770 inline bool nameIsCompute() { return FUNC_NAME_COMPUTE == getSymName(); }
771
774 inline bool nameIsConstrain() { return FUNC_NAME_CONSTRAIN == getSymName(); }
775
778 inline bool nameIsProduct() { return FUNC_NAME_PRODUCT == getSymName(); }
779
781 inline bool isInStruct() { return ::llzk::component::isInStruct(*this); }
782
784 inline bool isStructCompute() { return isInStruct() && nameIsCompute(); }
785
787 inline bool isStructConstrain() { return isInStruct() && nameIsConstrain(); }
788
790 inline bool isStructProduct() { return isInStruct() && nameIsProduct(); }
791
794 ::mlir::Value getSelfValueFromCompute();
795
798 ::mlir::Value getSelfValueFromConstrain();
799
802};
803} // namespace function
804} // namespace llzk
805MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::FuncDefOp)
806
807namespace llzk {
808namespace function {
809
810//===----------------------------------------------------------------------===//
811// ::llzk::function::ReturnOp declarations
812//===----------------------------------------------------------------------===//
813
814namespace detail {
816public:
817protected:
818 ::mlir::DictionaryAttr odsAttrs;
819 ::std::optional<::mlir::OperationName> odsOpName;
820 ::mlir::RegionRange odsRegions;
821public:
822 ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), odsRegions(regions) { if (odsAttrs)
823 odsOpName.emplace("function.return", odsAttrs.getContext());
824 }
825
826 ReturnOpGenericAdaptorBase(::mlir::Operation *op) : odsAttrs(op->getRawDictionaryAttrs()), odsOpName(op->getName()), odsRegions(op->getRegions()) {}
827
828 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
829 ::mlir::DictionaryAttr getAttributes() {
830 return odsAttrs;
831 }
832
833};
834} // namespace detail
835template <typename RangeT>
837 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
839public:
840 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = {}, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
841
842 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ReturnOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
843
844 ReturnOpGenericAdaptor(RangeT values, const ReturnOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
845
846 template <typename LateInst = ReturnOp, typename = std::enable_if_t<std::is_same_v<LateInst, ReturnOp>>>
847 ReturnOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
848
849 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
850 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
851 }
852
853 RangeT getODSOperands(unsigned index) {
854 auto valueRange = getODSOperandIndexAndLength(index);
855 return {std::next(odsOperands.begin(), valueRange.first),
856 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
857 }
858
859 RangeT getOperands() {
860 return getODSOperands(0);
861 }
862
863private:
864 RangeT odsOperands;
865};
866class ReturnOpAdaptor : public ReturnOpGenericAdaptor<::mlir::ValueRange> {
867public:
870
871 ::llvm::LogicalResult verify(::mlir::Location loc);
872};
873class ReturnOp : public ::mlir::Op<ReturnOp, ::mlir::OpTrait::ZeroRegions, ::mlir::OpTrait::ZeroResults, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::VariadicOperands, ::mlir::OpTrait::HasParent<::llzk::function::FuncDefOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::MemRefsNormalizable, ::mlir::RegionBranchTerminatorOpInterface::Trait, ::mlir::OpTrait::ReturnLike, ::mlir::OpTrait::IsTerminator> {
874public:
875 using Op::Op;
876 using Op::print;
878 template <typename RangeT>
881 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
882 return {};
883 }
884
885 static constexpr ::llvm::StringLiteral getOperationName() {
886 return ::llvm::StringLiteral("function.return");
887 }
888
889 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
890 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
891 auto valueRange = getODSOperandIndexAndLength(index);
892 return {std::next(getOperation()->operand_begin(), valueRange.first),
893 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
894 }
895
896 ::mlir::Operation::operand_range getOperands() {
897 return getODSOperands(0);
898 }
899
900 ::mlir::MutableOperandRange getOperandsMutable();
901 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
902 return {index, 1};
903 }
904
905 ::mlir::Operation::result_range getODSResults(unsigned index) {
906 auto valueRange = getODSResultIndexAndLength(index);
907 return {std::next(getOperation()->result_begin(), valueRange.first),
908 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
909 }
910
911 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState);
912 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands);
913 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
914 ::llvm::LogicalResult verifyInvariantsImpl();
915 ::llvm::LogicalResult verifyInvariants();
916 ::llvm::LogicalResult verify();
917 ::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point);
918 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
919 void print(::mlir::OpAsmPrinter &_odsPrinter);
920 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
921public:
922};
923} // namespace function
924} // namespace llzk
925MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::ReturnOp)
926
927
928#endif // GET_OP_CLASSES
929
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:173
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:133
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:144
CallOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:142
::llvm::SmallVector< RangeT > getMapOperands()
Definition Ops.h.inc:158
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs)
Definition Ops.h.inc:137
CallOpGenericAdaptor(RangeT values, const CallOpGenericAdaptorBase &base)
Definition Ops.h.inc:139
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:148
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:133
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:135
bool calleeContainsWitnessGen()
Return true iff the callee function can contain witness generation code (this does not check if the c...
Definition Ops.h.inc:335
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:482
bool calleeIsStructConstrain()
Return true iff the callee function name is FUNC_NAME_CONSTRAIN within a StructDefOp.
Definition Ops.cpp:761
::mlir::StringAttr getOperandSegmentSizesAttrName()
Definition Ops.h.inc:222
::mlir::CallInterfaceCallable getCallableForCallee()
Return the callee of this operation.
Definition Ops.cpp:795
::mlir::FunctionType getCalleeType()
Definition Ops.cpp:732
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the callee is FUNC_NAME_COMPUTE, return the single StructType result.
Definition Ops.cpp:784
::mlir::SymbolRefAttr getCalleeAttr()
Definition Ops.h.inc:267
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:701
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:379
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:388
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:330
bool calleeIsStructCompute()
Return true iff the callee function name is FUNC_NAME_COMPUTE within a StructDefOp.
Definition Ops.cpp:755
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:218
bool calleeIsConstrain()
Return true iff the callee function name is FUNC_NAME_CONSTRAIN (this does not check if the callee fu...
Definition Ops.h.inc:342
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:514
::mlir::SymbolRefAttr getCallee()
Definition Ops.cpp.inc:467
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:212
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:191
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:341
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:291
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:632
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:446
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:486
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange > mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands={})
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:230
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:354
bool calleeIsCompute()
Return true iff the callee function name is FUNC_NAME_COMPUTE (this does not check if the callee func...
Definition Ops.h.inc:329
::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:202
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands={})
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:477
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:191
::mlir::MutableOperandRange getArgOperandsMutable()
Definition Ops.cpp.inc:200
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:472
::mlir::Operation::operand_range getArgOperands()
Definition Ops.h.inc:241
CallOpAdaptor Adaptor
Definition Ops.h.inc:188
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
Definition Ops.cpp:772
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:564
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:206
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:568
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:660
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:230
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:245
static ::llvm::SmallVector<::mlir::ValueRange > toVectorOfValueRange(::mlir::OperandRangeRange)
Allocate consecutive storage of the ValueRange instances in the parameter so it can be passed to the ...
Definition Ops.cpp:802
::llzk::component::StructType getSingleResultTypeOfWitnessGen()
Assuming the callee contains witness generation code, return the single StructType result.
Definition Ops.cpp:789
FoldAdaptor::Properties Properties
Definition Ops.h.inc:192
void setCalleeAttr(::mlir::SymbolRefAttr attr)
Definition Ops.h.inc:282
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:277
::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:226
CallOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:190
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:286
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:214
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:292
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:206
::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:210
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:409
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:520
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:252
::mlir::StringAttr getCalleeAttrName()
Definition Ops.h.inc:198
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:193
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
Definition Ops.cpp:767
void setCalleeFromCallable(::mlir::CallInterfaceCallable callee)
Set the callee for this operation.
Definition Ops.cpp:798
::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp > > getCalleeTarget(::mlir::SymbolTableCollection &tables)
Resolve and return the target FuncDefOp for this CallOp.
Definition Ops.cpp:777
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:272
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:235
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:502
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:715
FuncDefOpGenericAdaptor(RangeT values, const FuncDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:508
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:513
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:506
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:517
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:502
FuncDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:511
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:504
::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:563
FuncDefOp clone(::mlir::IRMapping &mapper)
Create a deep copy of this function and all of its blocks, remapping any operands that use values out...
::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:571
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:862
void setAllowWitnessAttr(bool newValue=true)
Add (resp. remove) the allow_witness attribute to (resp. from) the function def.
Definition Ops.cpp:208
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:839
FoldAdaptor::Properties Properties
Definition Ops.h.inc:545
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:319
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
Definition Ops.cpp:346
::mlir::FunctionType getFunctionType()
Definition Ops.cpp.inc:952
void setArgAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:650
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs={}, ::llvm::ArrayRef<::mlir::DictionaryAttr > argAttrs={})
::mlir::StringAttr getSymNameAttrName()
Definition Ops.h.inc:575
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:601
::llvm::ArrayRef<::mlir::Type > getArgumentTypes()
Returns the argument types of this function.
Definition Ops.h.inc:749
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:640
::mlir::StringAttr getFunctionTypeAttrName()
Definition Ops.h.inc:559
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1076
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
Definition Ops.cpp:365
FuncDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:543
static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs, ::llvm::ArrayRef<::mlir::DictionaryAttr > argAttrs)
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:847
void print(::mlir::OpAsmPrinter &p)
Definition Ops.cpp:119
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:921
bool nameIsCompute()
Return true iff the function name is FUNC_NAME_COMPUTE (if needed, a check that this FuncDefOp is loc...
Definition Ops.h.inc:770
bool hasAllowWitnessAttr()
Return true iff the function def has the allow_witness attribute.
Definition Ops.h.inc:729
FuncDefOpAdaptor Adaptor
Definition Ops.h.inc:541
void setResAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:654
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the name is FUNC_NAME_COMPUTE, return the single StructType result.
Definition Ops.cpp:370
::mlir::Attribute removeResAttrsAttr()
Definition Ops.h.inc:664
::mlir::StringAttr getResAttrsAttrName()
Definition Ops.h.inc:567
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:962
::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:555
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp:108
void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper)
Clone the internal blocks and attributes from this function into dest.
Definition Ops.cpp:128
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:957
bool nameIsProduct()
Return true iff the function name is FUNC_NAME_PRODUCT (if needed, a check that this FuncDefOp is loc...
Definition Ops.h.inc:778
::mlir::ArrayAttr getArgAttrsAttr()
Definition Ops.h.inc:630
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:802
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:884
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:591
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:937
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:947
bool nameIsConstrain()
Return true iff the function name is FUNC_NAME_CONSTRAIN (if needed, a check that this FuncDefOp is l...
Definition Ops.h.inc:774
static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::mlir::Operation::dialect_attr_range attrs)
bool isStructCompute()
Return true iff the function is within a StructDefOp and named FUNC_NAME_COMPUTE.
Definition Ops.h.inc:784
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:587
bool isInStruct()
Return true iff the function is within a StructDefOp.
Definition Ops.h.inc:781
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:597
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:579
void setFunctionType(::mlir::FunctionType attrValue)
Definition Ops.cpp.inc:971
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:737
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:546
::llvm::ArrayRef<::mlir::Type > getResultTypes()
Returns the result types of this function.
Definition Ops.h.inc:752
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:583
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:544
bool isStructConstrain()
Return true iff the function is within a StructDefOp and named FUNC_NAME_CONSTRAIN.
Definition Ops.h.inc:787
void setAllowConstraintAttr(bool newValue=true)
Add (resp. remove) the allow_constraint attribute to (resp. from) the function def.
Definition Ops.cpp:200
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:967
static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs={})
::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent=true)
Return the full name for this function from the root module, including all surrounding symbol table n...
Definition Ops.cpp:336
::mlir::TypeAttr getFunctionTypeAttr()
Definition Ops.h.inc:625
bool hasArgPublicAttr(unsigned index)
Return true iff the argument at the given index has pub attribute.
Definition Ops.cpp:216
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:894
::mlir::Region * getCallableRegion()
Returns the region on the current operation that is callable.
Definition Ops.h.inc:746
::llvm::LogicalResult verify()
Definition Ops.cpp:226
::mlir::Region & getBody()
Definition Ops.h.inc:607
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:620
::mlir::ArrayAttr getResAttrsAttr()
Definition Ops.h.inc:635
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1047
bool isStructProduct()
Return true iff the function is within a StructDefOp and named FUNC_NAME_PRODUCT.
Definition Ops.h.inc:790
bool hasAllowConstraintAttr()
Return true iff the function def has the allow_constraint attribute.
Definition Ops.h.inc:721
void setFunctionTypeAttr(::mlir::TypeAttr attr)
Definition Ops.h.inc:645
::mlir::StringAttr getArgAttrsAttrName()
Definition Ops.h.inc:551
::mlir::Attribute removeArgAttrsAttr()
Definition Ops.h.inc:658
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:840
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1115
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:840
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:842
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:853
ReturnOpGenericAdaptor(RangeT values, const ReturnOpGenericAdaptorBase &base)
Definition Ops.h.inc:844
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:849
ReturnOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:847
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1204
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:905
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1119
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1159
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
Definition Ops.cpp.inc:1143
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:880
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:890
::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point)
Definition Ops.cpp.inc:1219
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:901
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:881
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1216
::llvm::LogicalResult verify()
Definition Ops.cpp:379
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:885
ReturnOpAdaptor Adaptor
Definition Ops.h.inc:877
::mlir::MutableOperandRange getOperandsMutable()
Definition Ops.cpp.inc:1137
ReturnOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:879
::mlir::Operation::operand_range getOperands()
Definition Ops.h.inc:896
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1172
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1178
CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:97
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:120
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:165
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:155
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:93
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:141
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:160
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:707
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:702
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:451
FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:445
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:441
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:819
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1094
ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs={}, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:822
constexpr char FUNC_NAME_COMPUTE[]
Symbol name for the witness generation (and resp.
Definition Constants.h:27
constexpr char FUNC_NAME_CONSTRAIN[]
Definition Constants.h:28
constexpr char FUNC_NAME_PRODUCT[]
Definition Constants.h:29
void setOperandSegmentSizes(::llvm::ArrayRef< int32_t > propValue)
Definition Ops.h.inc:75
void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:66
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:56
void setCallee(const ::mlir::SymbolRefAttr &propValue)
Definition Ops.h.inc:46
::llvm::ArrayRef< int32_t > getOperandSegmentSizes() const
Definition Ops.h.inc:71
void setResAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:414
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:424
void setArgAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:394
void setFunctionType(const ::mlir::TypeAttr &propValue)
Definition Ops.h.inc:404