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::function {
11
49class CallOp;
50
51} // namespace llzk::function
52namespace llzk::function {
53
104class FuncDefOp;
105
106} // namespace llzk::function
107namespace llzk::function {
108
123class ReturnOp;
124
125} // namespace llzk::function
126#ifdef GET_OP_CLASSES
127#undef GET_OP_CLASSES
128
129namespace llzk::function {
130
131
132//===----------------------------------------------------------------------===//
133// ::llzk::function::CallOp declarations
134//===----------------------------------------------------------------------===//
135
136namespace detail {
137
139public:
140 struct Properties {
141 using arg_attrsTy = ::mlir::ArrayAttr;
143
144 auto getArgAttrs() const {
145 auto &propStorage = this->arg_attrs;
146 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
147 }
148 void setArgAttrs(const ::mlir::ArrayAttr &propValue) {
149 this->arg_attrs = propValue;
150 }
151 using calleeTy = ::mlir::SymbolRefAttr;
153
154 auto getCallee() const {
155 auto &propStorage = this->callee;
156 return ::llvm::cast<::mlir::SymbolRefAttr>(propStorage);
157 }
158 void setCallee(const ::mlir::SymbolRefAttr &propValue) {
159 this->callee = propValue;
160 }
161 using mapOpGroupSizesTy = ::mlir::DenseI32ArrayAttr;
163
164 auto getMapOpGroupSizes() const {
165 auto &propStorage = this->mapOpGroupSizes;
166 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
167 }
168 void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue) {
169 this->mapOpGroupSizes = propValue;
170 }
171 using numDimsPerMapTy = ::mlir::DenseI32ArrayAttr;
173
174 auto getNumDimsPerMap() const {
175 auto &propStorage = this->numDimsPerMap;
176 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
177 }
178 void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue) {
179 this->numDimsPerMap = propValue;
180 }
181 using res_attrsTy = ::mlir::ArrayAttr;
183
184 auto getResAttrs() const {
185 auto &propStorage = this->res_attrs;
186 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
187 }
188 void setResAttrs(const ::mlir::ArrayAttr &propValue) {
189 this->res_attrs = propValue;
190 }
191 using templateParamsTy = ::mlir::ArrayAttr;
193
194 auto getTemplateParams() const {
195 auto &propStorage = this->templateParams;
196 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
197 }
198 void setTemplateParams(const ::mlir::ArrayAttr &propValue) {
199 this->templateParams = propValue;
200 }
201 using operandSegmentSizesTy = std::array<int32_t, 2>;
203 ::llvm::ArrayRef<int32_t> getOperandSegmentSizes() const {
204 auto &propStorage = this->operandSegmentSizes;
205 return propStorage;
206 }
207 void setOperandSegmentSizes(::llvm::ArrayRef<int32_t> propValue) {
208 auto &propStorage = this->operandSegmentSizes;
209 ::llvm::copy(propValue, propStorage.begin());
210 }
211 bool operator==(const Properties &rhs) const {
212 return
213 rhs.arg_attrs == this->arg_attrs &&
214 rhs.callee == this->callee &&
215 rhs.mapOpGroupSizes == this->mapOpGroupSizes &&
216 rhs.numDimsPerMap == this->numDimsPerMap &&
217 rhs.res_attrs == this->res_attrs &&
218 rhs.templateParams == this->templateParams &&
219 rhs.operandSegmentSizes == this->operandSegmentSizes &&
220 true;
221 }
222 bool operator!=(const Properties &rhs) const {
223 return !(*this == rhs);
224 }
225 };
226protected:
227 ::mlir::DictionaryAttr odsAttrs;
228 ::std::optional<::mlir::OperationName> odsOpName;
230 ::mlir::RegionRange odsRegions;
231public:
232 CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
233 odsOpName.emplace("function.call", odsAttrs.getContext());
234 }
235
237
238 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
240 return properties;
241 }
242
243 ::mlir::DictionaryAttr getAttributes() {
244 return odsAttrs;
245 }
246
247 ::mlir::SymbolRefAttr getCalleeAttr() {
248 auto attr = ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().callee);
249 return attr;
250 }
251
252 ::mlir::SymbolRefAttr getCallee();
253 ::mlir::ArrayAttr getTemplateParamsAttr() {
254 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().templateParams);
255 return attr;
256 }
257
258 ::std::optional< ::mlir::ArrayAttr > getTemplateParams();
259 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
260 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
261 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
262 auto attr = ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
263 return attr;
264 }
265
266 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
267 ::mlir::ArrayAttr getArgAttrsAttr() {
268 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().arg_attrs);
269 return attr;
270 }
271
272 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
273 ::mlir::ArrayAttr getResAttrsAttr() {
274 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().res_attrs);
275 return attr;
276 }
277
278 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
279};
280
281} // namespace detail
282template <typename RangeT>
284 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
286 static constexpr int odsIndex_argOperands = 0;
287 static constexpr int odsIndex_mapOperands = 1;
288public:
289 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
290
291 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CallOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
292
293 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs) : CallOpGenericAdaptor(values, attrs, Properties{}, {}) {}
294
295 CallOpGenericAdaptor(RangeT values, const CallOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
296
297 template <typename LateInst = CallOp, typename = std::enable_if_t<std::is_same_v<LateInst, CallOp>>>
298 CallOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
299
300 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
301 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
302 }
303
304 RangeT getODSOperands(unsigned index) {
305 auto valueRange = getODSOperandIndexAndLength(index);
306 return {std::next(odsOperands.begin(), valueRange.first),
307 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
308 }
309
310 RangeT getArgOperands() {
311 return getODSOperands(0);
312 }
313
314 ::llvm::SmallVector<RangeT> getMapOperands() {
315 auto tblgenTmpOperands = getODSOperands(1);
316 auto sizes = getMapOpGroupSizes();
317
318 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
319 for (int i = 0, e = sizes.size(); i < e; ++i) {
320 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
321 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
322 }
323 return tblgenTmpOperandGroups;
324 }
325
326 RangeT getOperands() {
327 return odsOperands;
328 }
329
330private:
331 RangeT odsOperands;
332};
333class CallOpAdaptor : public CallOpGenericAdaptor<::mlir::ValueRange> {
334public:
337
338 ::llvm::LogicalResult verify(::mlir::Location loc);
339};
340class 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::ArgAndResultAttrsOpInterface::Trait, ::mlir::CallOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait, ::llzk::LLZKCallLikeOpInterface::Trait> {
341public:
342 using Op::Op;
343 using Op::print;
345 template <typename RangeT>
348 static constexpr int odsIndex_argOperands = 0;
349 static constexpr int odsIndex_mapOperands = 1;
351 using ::llzk::LLZKCallLikeOpInterface::Trait<CallOp>::getTypeSignature;
352 using ::llzk::LLZKCallLikeOpInterface::Trait<CallOp>::unifyTypeSignatureWithNamespace;
353 using ::llzk::LLZKCallLikeOpInterface::Trait<CallOp>::unifyTypeSignature;
354 using ::llzk::LLZKCallLikeOpInterface::Trait<CallOp>::toVectorOfValueRange;
355 using ::llzk::LLZKCallLikeOpInterface::Trait<CallOp>::verifyTemplateParamValueCompatibility;
356 using ::llzk::LLZKCallLikeOpInterface::Trait<CallOp>::verifyTemplateParamValuesCompatibility;
357 using ::llzk::LLZKCallLikeOpInterface::Trait<CallOp>::verifyTemplateParamsMatchInferred;
358 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
359 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("arg_attrs"), ::llvm::StringRef("callee"), ::llvm::StringRef("mapOpGroupSizes"), ::llvm::StringRef("numDimsPerMap"), ::llvm::StringRef("res_attrs"), ::llvm::StringRef("templateParams"), ::llvm::StringRef("operandSegmentSizes")};
360 return ::llvm::ArrayRef(attrNames);
361 }
362
363 ::mlir::StringAttr getArgAttrsAttrName() {
364 return getAttributeNameForIndex(0);
365 }
366
367 static ::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name) {
368 return getAttributeNameForIndex(name, 0);
369 }
370
371 ::mlir::StringAttr getCalleeAttrName() {
372 return getAttributeNameForIndex(1);
373 }
374
375 static ::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name) {
376 return getAttributeNameForIndex(name, 1);
377 }
378
379 ::mlir::StringAttr getMapOpGroupSizesAttrName() {
380 return getAttributeNameForIndex(2);
381 }
382
383 static ::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name) {
384 return getAttributeNameForIndex(name, 2);
385 }
386
387 ::mlir::StringAttr getNumDimsPerMapAttrName() {
388 return getAttributeNameForIndex(3);
389 }
390
391 static ::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name) {
392 return getAttributeNameForIndex(name, 3);
393 }
394
395 ::mlir::StringAttr getResAttrsAttrName() {
396 return getAttributeNameForIndex(4);
397 }
398
399 static ::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name) {
400 return getAttributeNameForIndex(name, 4);
401 }
402
403 ::mlir::StringAttr getTemplateParamsAttrName() {
404 return getAttributeNameForIndex(5);
405 }
406
407 static ::mlir::StringAttr getTemplateParamsAttrName(::mlir::OperationName name) {
408 return getAttributeNameForIndex(name, 5);
409 }
410
411 ::mlir::StringAttr getOperandSegmentSizesAttrName() {
412 return (*this)->getName().getAttributeNames().back();
413 }
414
415 static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
416 return name.getAttributeNames().back();
417 }
418
419 static constexpr ::llvm::StringLiteral getOperationName() {
420 return ::llvm::StringLiteral("function.call");
421 }
422
423 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
424 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
425 auto valueRange = getODSOperandIndexAndLength(index);
426 return {std::next(getOperation()->operand_begin(), valueRange.first),
427 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
428 }
429
430 ::mlir::Operation::operand_range getArgOperands() {
431 return getODSOperands(0);
432 }
433
434 ::mlir::OperandRangeRange getMapOperands() {
435 return getODSOperands(1).split(getMapOpGroupSizesAttr());
436 }
437
438 ::mlir::MutableOperandRange getArgOperandsMutable();
439 ::mlir::MutableOperandRangeRange getMapOperandsMutable();
440 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
441 ::mlir::Operation::result_range getODSResults(unsigned index) {
442 auto valueRange = getODSResultIndexAndLength(index);
443 return {std::next(getOperation()->result_begin(), valueRange.first),
444 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
445 }
446
447 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
448 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
449 static llvm::hash_code computePropertiesHash(const Properties &prop);
450 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
451 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
452 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
453 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
454 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
455 void writeProperties(::mlir::DialectBytecodeWriter &writer);
456 ::mlir::SymbolRefAttr getCalleeAttr() {
457 return ::llvm::cast<::mlir::SymbolRefAttr>(getProperties().callee);
458 }
459
460 ::mlir::SymbolRefAttr getCallee();
461 ::mlir::ArrayAttr getTemplateParamsAttr() {
462 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().templateParams);
463 }
464
465 ::std::optional< ::mlir::ArrayAttr > getTemplateParams();
466 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr() {
467 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(getProperties().numDimsPerMap);
468 }
469
470 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
471 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr() {
472 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(getProperties().mapOpGroupSizes);
473 }
474
475 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
476 ::mlir::ArrayAttr getArgAttrsAttr() {
477 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().arg_attrs);
478 }
479
480 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
481 ::mlir::ArrayAttr getResAttrsAttr() {
482 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().res_attrs);
483 }
484
485 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
486 void setCalleeAttr(::mlir::SymbolRefAttr attr) {
487 getProperties().callee = attr;
488 }
489
490 void setTemplateParamsAttr(::mlir::ArrayAttr attr) {
491 getProperties().templateParams = attr;
492 }
493
494 void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr) {
495 getProperties().numDimsPerMap = attr;
496 }
497
498 void setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue);
499 void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr) {
500 getProperties().mapOpGroupSizes = attr;
501 }
502
503 void setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue);
504 void setArgAttrsAttr(::mlir::ArrayAttr attr) {
505 getProperties().arg_attrs = attr;
506 }
507
508 void setResAttrsAttr(::mlir::ArrayAttr attr) {
509 getProperties().res_attrs = attr;
510 }
511
512 ::mlir::Attribute removeTemplateParamsAttr() {
513 auto attr = getProperties().templateParams;
514 getProperties().templateParams = {};
515 return attr;
516 }
517
518 ::mlir::Attribute removeArgAttrsAttr() {
519 auto attr = getProperties().arg_attrs;
520 getProperties().arg_attrs = {};
521 return attr;
522 }
523
524 ::mlir::Attribute removeResAttrsAttr() {
525 auto attr = getProperties().res_attrs;
526 getProperties().res_attrs = {};
527 return attr;
528 }
529
530 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
531 static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
532 static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
533 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::ArrayRef<::mlir::Attribute> templateParams = {});
534 static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
535 static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
536 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 = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
537 static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
538 static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
539 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
540 static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
541 static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
542 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
543 static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
544 static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
545 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 = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
546 static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
547 static CallOp create(::mlir::ImplicitLocOpBuilder &builder, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::llvm::ArrayRef<int32_t> numDimsPerMap, ::mlir::ValueRange argOperands = {}, ::llvm::ArrayRef<::mlir::Attribute> templateParams = {});
548 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
549 ::llvm::LogicalResult verifyInvariantsImpl();
550 ::llvm::LogicalResult verifyInvariants();
551 ::mlir::CallInterfaceCallable getCallableForCallee();
552 void setCalleeFromCallable(::mlir::CallInterfaceCallable callee);
553 ::mlir::Operation *resolveCallableInTable(::mlir::SymbolTableCollection *symbolTable);
554 ::mlir::Operation *resolveCallable();
555 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
556 ::mlir::Value getSelfValue();
557 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
558 static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
559 void print(::mlir::OpAsmPrinter &_odsPrinter);
560private:
561 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
562 return getAttributeNameForIndex((*this)->getName(), index);
563 }
564
565 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
566 assert(index < 6 && "invalid attribute index");
567 assert(name.getStringRef() == getOperationName() && "invalid operation name");
568 assert(name.isRegistered() && "Operation isn't registered, missing a "
569 "dependent dialect loading?");
570 return name.getAttributeNames()[index];
571 }
572
573public:
576 inline bool calleeIsCompute() {
577 return FUNC_NAME_COMPUTE == getCallee().getLeafReference();
578 }
579
582 inline bool calleeIsProduct() {
583 return FUNC_NAME_PRODUCT == getCallee().getLeafReference();
584 }
585
589 return calleeIsCompute() || calleeIsProduct();
590 }
591
594 inline bool calleeIsConstrain() { return FUNC_NAME_CONSTRAIN == getCallee().getLeafReference(); }
595
598
601
604
609
612 ::mlir::Value getSelfValueFromCompute();
613
616 ::mlir::Value getSelfValueFromProduct();
617
620 ::mlir::Value getSelfValueFromConstrain();
621
623 ::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp>>
624 getCalleeTarget(::mlir::SymbolTableCollection &tables);
625
628
631
632};
633
634} // namespace llzk::function
635MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::CallOp)
637
638namespace llzk::function {
639
640
641//===----------------------------------------------------------------------===//
642// ::llzk::function::FuncDefOp declarations
643//===----------------------------------------------------------------------===//
644
645namespace detail {
646
648public:
649 struct Properties {
650 using arg_attrsTy = ::mlir::ArrayAttr;
652
653 auto getArgAttrs() const {
654 auto &propStorage = this->arg_attrs;
655 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
656 }
657 void setArgAttrs(const ::mlir::ArrayAttr &propValue) {
658 this->arg_attrs = propValue;
659 }
660 using function_typeTy = ::mlir::TypeAttr;
662
663 auto getFunctionType() const {
664 auto &propStorage = this->function_type;
665 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
666 }
667 void setFunctionType(const ::mlir::TypeAttr &propValue) {
668 this->function_type = propValue;
669 }
670 using res_attrsTy = ::mlir::ArrayAttr;
672
673 auto getResAttrs() const {
674 auto &propStorage = this->res_attrs;
675 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
676 }
677 void setResAttrs(const ::mlir::ArrayAttr &propValue) {
678 this->res_attrs = propValue;
679 }
680 using sym_nameTy = ::mlir::StringAttr;
682
683 auto getSymName() const {
684 auto &propStorage = this->sym_name;
685 return ::llvm::cast<::mlir::StringAttr>(propStorage);
686 }
687 void setSymName(const ::mlir::StringAttr &propValue) {
688 this->sym_name = propValue;
689 }
690 bool operator==(const Properties &rhs) const {
691 return
692 rhs.arg_attrs == this->arg_attrs &&
693 rhs.function_type == this->function_type &&
694 rhs.res_attrs == this->res_attrs &&
695 rhs.sym_name == this->sym_name &&
696 true;
697 }
698 bool operator!=(const Properties &rhs) const {
699 return !(*this == rhs);
700 }
701 };
702protected:
703 ::mlir::DictionaryAttr odsAttrs;
704 ::std::optional<::mlir::OperationName> odsOpName;
706 ::mlir::RegionRange odsRegions;
707public:
708 FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
709 odsOpName.emplace("function.def", odsAttrs.getContext());
710 }
711
713
714 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) {
715 return {index, 1};
716 }
717
719 return properties;
720 }
721
722 ::mlir::DictionaryAttr getAttributes() {
723 return odsAttrs;
724 }
725
726 ::mlir::StringAttr getSymNameAttr() {
727 auto attr = ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
728 return attr;
729 }
730
731 ::llvm::StringRef getSymName();
732 ::mlir::TypeAttr getFunctionTypeAttr() {
733 auto attr = ::llvm::cast<::mlir::TypeAttr>(getProperties().function_type);
734 return attr;
735 }
736
737 ::mlir::FunctionType getFunctionType();
738 ::mlir::ArrayAttr getArgAttrsAttr() {
739 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().arg_attrs);
740 return attr;
741 }
742
743 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
744 ::mlir::ArrayAttr getResAttrsAttr() {
745 auto attr = ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().res_attrs);
746 return attr;
747 }
748
749 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
750 ::mlir::Region &getBody() {
751 return *odsRegions[0];
752 }
753
754 ::mlir::RegionRange getRegions() {
755 return odsRegions;
756 }
757
758};
759
760} // namespace detail
761template <typename RangeT>
763 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
765public:
766 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
767
768 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : FuncDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
769
770 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : FuncDefOpGenericAdaptor(values, attrs, Properties{}, {}) {}
771
772 FuncDefOpGenericAdaptor(RangeT values, const FuncDefOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
773
774 template <typename LateInst = FuncDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, FuncDefOp>>>
775 FuncDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
776
777 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
778 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
779 }
780
781 RangeT getODSOperands(unsigned index) {
782 auto valueRange = getODSOperandIndexAndLength(index);
783 return {std::next(odsOperands.begin(), valueRange.first),
784 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
785 }
786
787 RangeT getOperands() {
788 return odsOperands;
789 }
790
791private:
792 RangeT odsOperands;
793};
794class FuncDefOpAdaptor : public FuncDefOpGenericAdaptor<::mlir::ValueRange> {
795public:
798
799 ::llvm::LogicalResult verify(::mlir::Location loc);
800};
801class 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, ::llzk::polymorphic::TemplateOp>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::SymbolUserOpInterface::Trait, ::mlir::OpTrait::AffineScope, ::mlir::OpTrait::AutomaticAllocationScope, ::mlir::SymbolOpInterface::Trait, ::mlir::ArgAndResultAttrsOpInterface::Trait, ::mlir::CallableOpInterface::Trait, ::mlir::FunctionOpInterface::Trait, ::mlir::OpTrait::IsIsolatedFromAbove, ::llzk::verif::ContractTargetOpInterface::Trait> {
802public:
803 using Op::Op;
804 using Op::print;
806 template <typename RangeT>
810 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
811 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("arg_attrs"), ::llvm::StringRef("function_type"), ::llvm::StringRef("res_attrs"), ::llvm::StringRef("sym_name")};
812 return ::llvm::ArrayRef(attrNames);
813 }
814
815 ::mlir::StringAttr getArgAttrsAttrName() {
816 return getAttributeNameForIndex(0);
817 }
818
819 static ::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name) {
820 return getAttributeNameForIndex(name, 0);
821 }
822
823 ::mlir::StringAttr getFunctionTypeAttrName() {
824 return getAttributeNameForIndex(1);
825 }
826
827 static ::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name) {
828 return getAttributeNameForIndex(name, 1);
829 }
830
831 ::mlir::StringAttr getResAttrsAttrName() {
832 return getAttributeNameForIndex(2);
833 }
834
835 static ::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name) {
836 return getAttributeNameForIndex(name, 2);
837 }
838
839 ::mlir::StringAttr getSymNameAttrName() {
840 return getAttributeNameForIndex(3);
841 }
842
843 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
844 return getAttributeNameForIndex(name, 3);
845 }
846
847 static constexpr ::llvm::StringLiteral getOperationName() {
848 return ::llvm::StringLiteral("function.def");
849 }
850
851 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
852 return {index, 1};
853 }
854
855 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
856 auto valueRange = getODSOperandIndexAndLength(index);
857 return {std::next(getOperation()->operand_begin(), valueRange.first),
858 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
859 }
860
861 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
862 return {index, 1};
863 }
864
865 ::mlir::Operation::result_range getODSResults(unsigned index) {
866 auto valueRange = getODSResultIndexAndLength(index);
867 return {std::next(getOperation()->result_begin(), valueRange.first),
868 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
869 }
870
871 ::mlir::Region &getBody() {
872 return (*this)->getRegion(0);
873 }
874
875 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
876 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
877 static llvm::hash_code computePropertiesHash(const Properties &prop);
878 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
879 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
880 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
881 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
882 static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
883 void writeProperties(::mlir::DialectBytecodeWriter &writer);
884 ::mlir::StringAttr getSymNameAttr() {
885 return ::llvm::cast<::mlir::StringAttr>(getProperties().sym_name);
886 }
887
888 ::llvm::StringRef getSymName();
889 ::mlir::TypeAttr getFunctionTypeAttr() {
890 return ::llvm::cast<::mlir::TypeAttr>(getProperties().function_type);
891 }
892
893 ::mlir::FunctionType getFunctionType();
894 ::mlir::ArrayAttr getArgAttrsAttr() {
895 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().arg_attrs);
896 }
897
898 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
899 ::mlir::ArrayAttr getResAttrsAttr() {
900 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(getProperties().res_attrs);
901 }
902
903 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
904 void setSymNameAttr(::mlir::StringAttr attr) {
905 getProperties().sym_name = attr;
906 }
907
908 void setSymName(::llvm::StringRef attrValue);
909 void setFunctionTypeAttr(::mlir::TypeAttr attr) {
910 getProperties().function_type = attr;
911 }
912
913 void setFunctionType(::mlir::FunctionType attrValue);
914 void setArgAttrsAttr(::mlir::ArrayAttr attr) {
915 getProperties().arg_attrs = attr;
916 }
917
918 void setResAttrsAttr(::mlir::ArrayAttr attr) {
919 getProperties().res_attrs = attr;
920 }
921
922 ::mlir::Attribute removeArgAttrsAttr() {
923 auto attr = getProperties().arg_attrs;
924 getProperties().arg_attrs = {};
925 return attr;
926 }
927
928 ::mlir::Attribute removeResAttrsAttr() {
929 auto attr = getProperties().res_attrs;
930 getProperties().res_attrs = {};
931 return attr;
932 }
933
934 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 = {});
935 static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {}, ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs = {});
936 static FuncDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {}, ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs = {});
937 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);
938 static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
939 static FuncDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
940 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);
941 static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
942 static FuncDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::StringAttr sym_name, ::mlir::TypeAttr function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
943 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);
944 static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
945 static FuncDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
946 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);
947 static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
948 static FuncDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::llvm::StringRef sym_name, ::mlir::FunctionType function_type, /*optional*/::mlir::ArrayAttr arg_attrs, /*optional*/::mlir::ArrayAttr res_attrs);
949 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
950 static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
951 static FuncDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
952 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
953 static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
954 static FuncDefOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
955 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
956 void print(::mlir::OpAsmPrinter &p);
957 ::llvm::LogicalResult verifyInvariantsImpl();
958 ::llvm::LogicalResult verifyInvariants();
959 ::llvm::LogicalResult verify();
960 ::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
961 static ::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
962private:
963 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
964 return getAttributeNameForIndex((*this)->getName(), index);
965 }
966
967 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
968 assert(index < 4 && "invalid attribute index");
969 assert(name.getStringRef() == getOperationName() && "invalid operation name");
970 assert(name.isRegistered() && "Operation isn't registered, missing a "
971 "dependent dialect loading?");
972 return name.getAttributeNames()[index];
973 }
974
975public:
976 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
977 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {});
978 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
979 ::mlir::Operation::dialect_attr_range attrs);
980 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
981 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs,
982 ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs);
983
991 FuncDefOp clone(::mlir::IRMapping &mapper);
993
998 void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper);
999
1002 return getOperation()->hasAttr(llzk::function::AllowConstraintAttr::name);
1003 }
1004
1006 void setAllowConstraintAttr(bool newValue = true);
1007
1009 inline bool hasAllowWitnessAttr() {
1010 return getOperation()->hasAttr(llzk::function::AllowWitnessAttr::name);
1011 }
1012
1014 void setAllowWitnessAttr(bool newValue = true);
1015
1018 return getOperation()->hasAttr(llzk::function::AllowNonNativeFieldOpsAttr::name);
1019 }
1020
1022 void setAllowNonNativeFieldOpsAttr(bool newValue = true);
1023
1025 inline bool hasAllowVerifOpsAttr() {
1026 return getOperation()->hasAttr(llzk::function::AllowVerifOpsAttr::name);
1027 }
1028
1030 void setAllowVerifOpsAttr(bool newValue = true);
1031
1033 bool hasArgPublicAttr(unsigned index);
1034
1036 bool hasArgName(unsigned index);
1037
1039 ::std::optional<::mlir::StringAttr> getArgNameAttr(unsigned index);
1040
1042 void setArgNameAttr(unsigned index, const ::mlir::StringAttr &attr);
1043
1045 void setArgName(unsigned index, ::llvm::StringRef name);
1046
1048 bool hasResName(unsigned index);
1049
1051 ::std::optional<::mlir::StringAttr> getResNameAttr(unsigned index);
1052
1054 void setResNameAttr(unsigned index, const ::mlir::StringAttr &attr);
1055
1057 void setResName(unsigned index, ::llvm::StringRef name);
1058
1063 ::mlir::Region *getCallableRegion() { return isExternal() ? nullptr : &getBody(); }
1064
1067 ::llvm::ArrayRef<::mlir::Type> getArgumentTypes() { return getFunctionType().getInputs(); }
1068
1071 ::llvm::ArrayRef<::mlir::Type> getResultTypes() { return getFunctionType().getResults(); }
1072
1074 bool isDeclaration() { return isExternal(); }
1075
1078 ::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent = true);
1079
1082 inline bool nameIsCompute() { return FUNC_NAME_COMPUTE == getSymName(); }
1083
1086 inline bool nameIsConstrain() { return FUNC_NAME_CONSTRAIN == getSymName(); }
1087
1090 inline bool nameIsProduct() { return FUNC_NAME_PRODUCT == getSymName(); }
1091
1093 inline bool isInStruct() { return ::llzk::component::isInStruct(*this); }
1094
1096 inline bool isStructCompute() { return isInStruct() && nameIsCompute(); }
1097
1099 inline bool isStructConstrain() { return isInStruct() && nameIsConstrain(); }
1100
1102 inline bool isStructProduct() { return isInStruct() && nameIsProduct(); }
1103
1106 ::mlir::Value getSelfValueFromCompute();
1107
1110 ::mlir::Value getSelfValueFromProduct();
1111
1114 ::mlir::Value getSelfValueFromConstrain();
1115
1118};
1119
1120} // namespace llzk::function
1121MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::FuncDefOp)
1123
1124namespace llzk::function {
1125
1126
1127//===----------------------------------------------------------------------===//
1128// ::llzk::function::ReturnOp declarations
1129//===----------------------------------------------------------------------===//
1130
1131namespace detail {
1132
1134public:
1135 using Properties = ::mlir::EmptyProperties;
1136protected:
1137 ::mlir::DictionaryAttr odsAttrs;
1138 ::std::optional<::mlir::OperationName> odsOpName;
1140 ::mlir::RegionRange odsRegions;
1141public:
1142 ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs)
1143 odsOpName.emplace("function.return", odsAttrs.getContext());
1144 }
1145
1147
1148 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
1150 return properties;
1151 }
1152
1153 ::mlir::DictionaryAttr getAttributes() {
1154 return odsAttrs;
1155 }
1156
1157};
1158
1159} // namespace detail
1160template <typename RangeT>
1162 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
1164 static constexpr int odsIndex_operands = 0;
1165public:
1166 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
1167
1168 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ReturnOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
1169
1170 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ReturnOpGenericAdaptor(values, attrs, Properties{}, {}) {}
1171
1172 ReturnOpGenericAdaptor(RangeT values, const ReturnOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {}
1173
1174 template <typename LateInst = ReturnOp, typename = std::enable_if_t<std::is_same_v<LateInst, ReturnOp>>>
1175 ReturnOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
1176
1177 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
1178 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
1179 }
1180
1181 RangeT getODSOperands(unsigned index) {
1182 auto valueRange = getODSOperandIndexAndLength(index);
1183 return {std::next(odsOperands.begin(), valueRange.first),
1184 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
1185 }
1186
1187 RangeT getOperands() {
1188 return getODSOperands(0);
1189 }
1190
1191private:
1192 RangeT odsOperands;
1193};
1194class ReturnOpAdaptor : public ReturnOpGenericAdaptor<::mlir::ValueRange> {
1195public:
1198
1199 ::llvm::LogicalResult verify(::mlir::Location loc);
1200};
1201class 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> {
1202public:
1203 using Op::Op;
1204 using Op::print;
1206 template <typename RangeT>
1209 static constexpr int odsIndex_operands = 0;
1211 using ::mlir::RegionBranchTerminatorOpInterface::Trait<ReturnOp>::getMutableSuccessorOperands;
1212 using ::mlir::RegionBranchTerminatorOpInterface::Trait<ReturnOp>::getSuccessorRegions;
1213 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
1214 return {};
1215 }
1216
1217 static constexpr ::llvm::StringLiteral getOperationName() {
1218 return ::llvm::StringLiteral("function.return");
1219 }
1220
1221 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
1222 ::mlir::Operation::operand_range getODSOperands(unsigned index) {
1223 auto valueRange = getODSOperandIndexAndLength(index);
1224 return {std::next(getOperation()->operand_begin(), valueRange.first),
1225 std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)};
1226 }
1227
1228 ::mlir::Operation::operand_range getOperands() {
1229 return getODSOperands(0);
1230 }
1231
1232 ::mlir::MutableOperandRange getOperandsMutable();
1233 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index) {
1234 return {index, 1};
1235 }
1236
1237 ::mlir::Operation::result_range getODSResults(unsigned index) {
1238 auto valueRange = getODSResultIndexAndLength(index);
1239 return {std::next(getOperation()->result_begin(), valueRange.first),
1240 std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)};
1241 }
1242
1243 static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1244 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
1245 static llvm::hash_code computePropertiesHash(const Properties &prop);
1246 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
1247 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
1248 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
1249 static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
1250 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState);
1251 static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location);
1252 static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder);
1253 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands);
1254 static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands);
1255 static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands);
1256 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1257 static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1258 static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
1259 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
1260 static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
1261 static ReturnOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {});
1262 ::llvm::LogicalResult verifyInvariantsImpl();
1263 ::llvm::LogicalResult verifyInvariants();
1264 ::llvm::LogicalResult verify();
1265 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
1266 void print(::mlir::OpAsmPrinter &_odsPrinter);
1267 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
1268public:
1269};
1270
1271} // namespace llzk::function
1272MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::ReturnOp)
1273
1274
1275#endif // GET_OP_CLASSES
1276
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:200
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:289
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:300
CallOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:298
::llvm::SmallVector< RangeT > getMapOperands()
Definition Ops.h.inc:314
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs)
Definition Ops.h.inc:293
CallOpGenericAdaptor(RangeT values, const CallOpGenericAdaptorBase &base)
Definition Ops.h.inc:295
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:304
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:289
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:291
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands={}, ::llvm::ArrayRef<::mlir::Attribute > templateParams={})
bool calleeContainsWitnessGen()
Return true iff the callee function can contain witness generation code (this does not check if the c...
Definition Ops.h.inc:588
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:596
bool calleeIsStructConstrain()
Return true iff the callee function name is FUNC_NAME_CONSTRAIN within a StructDefOp.
Definition Ops.cpp:1004
::mlir::StringAttr getTemplateParamsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:407
::mlir::StringAttr getOperandSegmentSizesAttrName()
Definition Ops.h.inc:411
::mlir::CallInterfaceCallable getCallableForCallee()
Return the callee of this operation.
Definition Ops.cpp:1055
static constexpr int odsIndex_mapOperands
Definition Ops.h.inc:349
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the callee is FUNC_NAME_COMPUTE, return the single StructType result.
Definition Ops.cpp:1044
::mlir::SymbolRefAttr getCalleeAttr()
Definition Ops.h.inc:456
::mlir::Value getSelfValueFromProduct()
Return the "self" value (i.e.
Definition Ops.cpp:1015
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:933
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:512
static constexpr int odsIndex_argOperands
Definition Ops.h.inc:348
::mlir::Operation * resolveCallableInTable(::mlir::SymbolTableCollection *symbolTable)
Definition Ops.cpp:1062
::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:399
bool calleeIsInStruct()
Return true iff the callee function is within a StructDefOp.
Definition Ops.h.inc:606
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:527
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:434
::mlir::Value getSelfValue()
Definition Ops.cpp:1025
bool calleeIsStructCompute()
Return true iff the callee function name is FUNC_NAME_COMPUTE within a StructDefOp.
Definition Ops.cpp:992
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:391
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:594
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:704
::mlir::StringAttr getResAttrsAttrName()
Definition Ops.h.inc:395
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:586
bool calleeIsProduct()
Return true iff the callee function name is FUNC_NAME_PRODUCT (this does not check if the callee func...
Definition Ops.h.inc:582
::mlir::SymbolRefAttr getCallee()
Definition Ops.cpp.inc:566
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:251
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:347
::mlir::Operation * resolveCallable()
Definition Ops.cpp:1072
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:450
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:499
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:845
::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:367
::mlir::ArrayAttr getArgAttrsAttr()
Definition Ops.h.inc:476
::mlir::StringAttr getArgAttrsAttrName()
Definition Ops.h.inc:363
void setArgAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:504
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp:591
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:600
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:269
::mlir::StringAttr getTemplateParamsAttrName()
Definition Ops.h.inc:403
bool calleeIsStructProduct()
Return true iff the callee function name is FUNC_NAME_PRODUCT within a StructDefOp.
Definition Ops.cpp:998
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:472
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:576
::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:375
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:581
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:230
::mlir::MutableOperandRange getArgOperandsMutable()
Definition Ops.cpp.inc:239
void setTemplateParamsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:490
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:576
::mlir::Operation::operand_range getArgOperands()
Definition Ops.h.inc:430
CallOpAdaptor Adaptor
Definition Ops.h.inc:344
static CallOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands={}, ::llvm::ArrayRef<::mlir::Attribute > templateParams={})
Definition Ops.cpp.inc:604
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
Definition Ops.cpp:1020
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:766
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:379
void setResAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:508
::mlir::ArrayAttr getTemplateParamsAttr()
Definition Ops.h.inc:461
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::ArrayRef<::mlir::Attribute > templateParams={})
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:770
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:928
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:419
::mlir::OperandRangeRange getMapOperands()
Definition Ops.h.inc:434
::mlir::ArrayAttr getResAttrsAttr()
Definition Ops.h.inc:481
::llzk::component::StructType getSingleResultTypeOfWitnessGen()
Assuming the callee contains witness generation code, return the single StructType result.
Definition Ops.cpp:1049
FoldAdaptor::Properties Properties
Definition Ops.h.inc:350
void setCalleeAttr(::mlir::SymbolRefAttr attr)
Definition Ops.h.inc:486
::mlir::Attribute removeResAttrsAttr()
Definition Ops.h.inc:524
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:471
::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:415
::mlir::Attribute removeTemplateParamsAttr()
Definition Ops.h.inc:512
CallOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:346
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
Definition Ops.cpp.inc:571
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp:553
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.h.inc:494
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:387
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:375
::mlir::Attribute removeArgAttrsAttr()
Definition Ops.h.inc:518
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:245
::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:383
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:710
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:441
::mlir::StringAttr getCalleeAttrName()
Definition Ops.h.inc:371
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:591
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:358
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
Definition Ops.cpp:1010
void setCalleeFromCallable(::mlir::CallInterfaceCallable callee)
Set the callee for this operation.
Definition Ops.cpp:1058
::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp > > getCalleeTarget(::mlir::SymbolTableCollection &tables)
Resolve and return the target FuncDefOp for this CallOp.
Definition Ops.cpp:1037
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.h.inc:466
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:424
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:766
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:991
FuncDefOpGenericAdaptor(RangeT values, const FuncDefOpGenericAdaptorBase &base)
Definition Ops.h.inc:772
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:768
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:777
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:770
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:781
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:766
FuncDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:775
::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:827
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:835
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1139
void setAllowWitnessAttr(bool newValue=true)
Add (resp. remove) the allow_witness attribute to (resp. from) the function def.
Definition Ops.cpp:282
static FuncDefOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::llvm::ArrayRef<::mlir::NamedAttribute > attrs={}, ::llvm::ArrayRef<::mlir::DictionaryAttr > argAttrs={})
Definition Ops.cpp.inc:1252
void setArgNameAttr(unsigned index, const ::mlir::StringAttr &attr)
Set the function.arg_name attribute for the argument at the given index.
Definition Ops.cpp:322
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1115
FoldAdaptor::Properties Properties
Definition Ops.h.inc:809
void setArgName(unsigned index, ::llvm::StringRef name)
Set the function.arg_name attribute for the argument at the given index from a string.
Definition Ops.cpp:327
::llvm::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:461
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
Definition Ops.cpp:502
::mlir::FunctionType getFunctionType()
Definition Ops.cpp.inc:1229
void setArgAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:914
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:839
void setAllowNonNativeFieldOpsAttr(bool newValue=true)
Add (resp. remove) the allow_non_native_field_ops attribute to (resp. from) the function def.
Definition Ops.cpp:290
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:865
::llvm::ArrayRef<::mlir::Type > getArgumentTypes()
Required by FunctionOpInterface.
Definition Ops.h.inc:1067
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.h.inc:904
void setResNameAttr(unsigned index, const ::mlir::StringAttr &attr)
Set the function.res_name attribute for the result at the given index.
Definition Ops.cpp:337
::mlir::StringAttr getFunctionTypeAttrName()
Definition Ops.h.inc:823
bool hasAllowNonNativeFieldOpsAttr()
Return true iff the function def has the allow_non_native_field_ops attribute.
Definition Ops.h.inc:1017
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1448
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
Definition Ops.cpp:512
::mlir::Value getSelfValueFromProduct()
Return the "self" value (i.e.
Definition Ops.cpp:507
FuncDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:807
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:1124
void print(::mlir::OpAsmPrinter &p)
Definition Ops.cpp:193
::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1198
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:1082
bool hasAllowWitnessAttr()
Return true iff the function def has the allow_witness attribute.
Definition Ops.h.inc:1009
FuncDefOpAdaptor Adaptor
Definition Ops.h.inc:805
void setResAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.h.inc:918
::llvm::LogicalResult setPropertiesFromParsedAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1454
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the name is FUNC_NAME_COMPUTE, return the single StructType result.
Definition Ops.cpp:517
::mlir::Attribute removeResAttrsAttr()
Definition Ops.h.inc:928
::mlir::StringAttr getResAttrsAttrName()
Definition Ops.h.inc:831
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:1239
::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:819
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp:182
bool hasArgName(unsigned index)
Return true iff the argument at the given index has a function.arg_name attribute.
Definition Ops.cpp:316
void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper)
Clone the internal blocks and attributes from this function into dest.
Definition Ops.cpp:202
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:1234
void setAllowVerifOpsAttr(bool newValue=true)
Add (resp. remove) the allow_verif_ops attribute to (resp. from) the function def.
Definition Ops.cpp:298
bool hasResName(unsigned index)
Return true iff the result at the given index has a function.res_name attribute.
Definition Ops.cpp:331
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:1090
::std::optional<::mlir::StringAttr > getArgNameAttr(unsigned index)
Return the function.arg_name attribute for the argument at the given index.
Definition Ops.cpp:318
::mlir::ArrayAttr getArgAttrsAttr()
Definition Ops.h.inc:894
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1078
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1161
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:855
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1214
::std::optional<::mlir::StringAttr > getResNameAttr(unsigned index)
Return the function.res_name attribute for the result at the given index.
Definition Ops.cpp:333
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1224
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:1086
static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type, ::mlir::Operation::dialect_attr_range attrs)
bool hasAllowVerifOpsAttr()
Return true iff the function def has the allow_verif_ops attribute.
Definition Ops.h.inc:1025
bool isStructCompute()
Return true iff the function is within a StructDefOp and named FUNC_NAME_COMPUTE.
Definition Ops.h.inc:1096
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:851
void setResName(unsigned index, ::llvm::StringRef name)
Set the function.res_name attribute for the result at the given index from a string.
Definition Ops.cpp:342
bool isInStruct()
Return true iff the function is within a StructDefOp.
Definition Ops.h.inc:1093
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:861
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:843
void setFunctionType(::mlir::FunctionType attrValue)
Definition Ops.cpp.inc:1248
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1013
bool isDeclaration()
Required by SymbolOpInterface.
Definition Ops.h.inc:1074
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:810
::llvm::ArrayRef<::mlir::Type > getResultTypes()
Required by FunctionOpInterface.
Definition Ops.h.inc:1071
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:847
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:808
bool isStructConstrain()
Return true iff the function is within a StructDefOp and named FUNC_NAME_CONSTRAIN.
Definition Ops.h.inc:1099
void setAllowConstraintAttr(bool newValue=true)
Add (resp. remove) the allow_constraint attribute to (resp. from) the function def.
Definition Ops.cpp:274
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1244
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:477
::mlir::TypeAttr getFunctionTypeAttr()
Definition Ops.h.inc:889
bool hasArgPublicAttr(unsigned index)
Return true iff the argument at the given index has pub attribute.
Definition Ops.cpp:306
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1171
::mlir::Region * getCallableRegion()
Required by FunctionOpInterface.
Definition Ops.h.inc:1063
::llvm::LogicalResult verify()
Definition Ops.cpp:346
::mlir::Region & getBody()
Definition Ops.h.inc:871
::mlir::StringAttr getSymNameAttr()
Definition Ops.h.inc:884
::mlir::ArrayAttr getResAttrsAttr()
Definition Ops.h.inc:899
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1419
bool isStructProduct()
Return true iff the function is within a StructDefOp and named FUNC_NAME_PRODUCT.
Definition Ops.h.inc:1102
bool hasAllowConstraintAttr()
Return true iff the function def has the allow_constraint attribute.
Definition Ops.h.inc:1001
void setFunctionTypeAttr(::mlir::TypeAttr attr)
Definition Ops.h.inc:909
::mlir::StringAttr getArgAttrsAttrName()
Definition Ops.h.inc:815
::mlir::Attribute removeArgAttrsAttr()
Definition Ops.h.inc:922
::llvm::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1596
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1166
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1168
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr)
Definition Ops.h.inc:1170
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1166
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:1181
ReturnOpGenericAdaptor(RangeT values, const ReturnOpGenericAdaptorBase &base)
Definition Ops.h.inc:1172
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:1177
ReturnOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:1175
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1782
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1654
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.h.inc:1237
FoldAdaptor::Properties Properties
Definition Ops.h.inc:1210
static ReturnOp create(::mlir::OpBuilder &builder, ::mlir::Location location)
Definition Ops.cpp.inc:1666
::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1657
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1600
::llvm::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1733
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
Definition Ops.cpp.inc:1661
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:1208
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:1642
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.h.inc:1222
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.h.inc:1233
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:1213
::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1624
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1794
::llvm::LogicalResult verify()
Definition Ops.cpp:526
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:1217
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:1651
ReturnOpAdaptor Adaptor
Definition Ops.h.inc:1205
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:1647
::mlir::MutableOperandRange getOperandsMutable()
Definition Ops.cpp.inc:1618
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:1633
ReturnOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:1207
::mlir::Operation::operand_range getOperands()
Definition Ops.h.inc:1228
::llvm::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1746
static constexpr int odsIndex_operands
Definition Ops.h.inc:1209
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1752
CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:232
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.h.inc:261
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:186
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:181
::std::optional< ::mlir::ArrayAttr > getTemplateParams()
Definition Ops.cpp.inc:166
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:171
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:228
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:152
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:176
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:191
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:982
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:977
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.h.inc:714
FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:708
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:704
ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:1142
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:1138
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1574
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
constexpr char FUNC_NAME_PRODUCT[]
Definition Constants.h:18
void setTemplateParams(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:198
void setArgAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:148
void setOperandSegmentSizes(::llvm::ArrayRef< int32_t > propValue)
Definition Ops.h.inc:207
void setResAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:188
void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:178
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:168
void setCallee(const ::mlir::SymbolRefAttr &propValue)
Definition Ops.h.inc:158
::llvm::ArrayRef< int32_t > getOperandSegmentSizes() const
Definition Ops.h.inc:203
void setResAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:677
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:687
void setArgAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:657
void setFunctionType(const ::mlir::TypeAttr &propValue)
Definition Ops.h.inc:667