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
10#if defined(GET_OP_CLASSES) || defined(GET_OP_FWD_DEFINES)
11#undef GET_OP_FWD_DEFINES
12namespace llzk {
13namespace function {
14class CallOp;
15} // namespace function
16} // namespace llzk
17namespace llzk {
18namespace function {
19class FuncDefOp;
20} // namespace function
21} // namespace llzk
22namespace llzk {
23namespace function {
24class ReturnOp;
25} // namespace function
26} // namespace llzk
27#endif
28
29#ifdef GET_OP_CLASSES
30#undef GET_OP_CLASSES
31
32
33//===----------------------------------------------------------------------===//
34// Local Utility Method Definitions
35//===----------------------------------------------------------------------===//
36
37namespace llzk {
38namespace function {
39
40//===----------------------------------------------------------------------===//
41// ::llzk::function::CallOp declarations
42//===----------------------------------------------------------------------===//
43
44namespace detail {
46public:
47 struct Properties {
48 using calleeTy = ::mlir::SymbolRefAttr;
50
51 auto getCallee() {
52 auto &propStorage = this->callee;
53 return ::llvm::cast<::mlir::SymbolRefAttr>(propStorage);
54 }
55 void setCallee(const ::mlir::SymbolRefAttr &propValue) {
56 this->callee = propValue;
57 }
58 using mapOpGroupSizesTy = ::mlir::DenseI32ArrayAttr;
60
62 auto &propStorage = this->mapOpGroupSizes;
63 return ::llvm::cast<::mlir::DenseI32ArrayAttr>(propStorage);
64 }
65 void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue) {
66 this->mapOpGroupSizes = propValue;
67 }
68 using numDimsPerMapTy = ::mlir::DenseI32ArrayAttr;
70
72 auto &propStorage = this->numDimsPerMap;
73 return ::llvm::dyn_cast_or_null<::mlir::DenseI32ArrayAttr>(propStorage);
74 }
75 void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue) {
76 this->numDimsPerMap = propValue;
77 }
78 using operandSegmentSizesTy = std::array<int32_t, 2>;
80 ::llvm::ArrayRef<int32_t> getOperandSegmentSizes() {
81 auto &propStorage = this->operandSegmentSizes;
82 return propStorage;
83 }
84 void setOperandSegmentSizes(const ::llvm::ArrayRef<int32_t> &propValue) {
85 auto &propStorage = this->operandSegmentSizes;
86 ::llvm::copy(propValue, propStorage.begin());
87 }
88 bool operator==(const Properties &rhs) const {
89 return
90 rhs.callee == this->callee &&
91 rhs.mapOpGroupSizes == this->mapOpGroupSizes &&
92 rhs.numDimsPerMap == this->numDimsPerMap &&
93 rhs.operandSegmentSizes == this->operandSegmentSizes &&
94 true;
95 }
96 bool operator!=(const Properties &rhs) const {
97 return !(*this == rhs);
98 }
99 };
100protected:
101 ::mlir::DictionaryAttr odsAttrs;
102 ::std::optional<::mlir::OperationName> odsOpName;
104 ::mlir::RegionRange odsRegions;
105public:
106 CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties = {}, ::mlir::RegionRange regions = {});
107
109
110 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
112 return properties;
113 }
114
115 ::mlir::DictionaryAttr getAttributes();
116 ::mlir::SymbolRefAttr getCalleeAttr();
117 ::mlir::SymbolRefAttr getCallee();
118 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
119 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
120 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr();
121 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
122};
123} // namespace detail
124template <typename RangeT>
126 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
128public:
129 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
130
131 CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : CallOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
132
133 template <typename LateInst = CallOp, typename = std::enable_if_t<std::is_same_v<LateInst, CallOp>>>
134 CallOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
135
136 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
137 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
138 }
139
140 RangeT getODSOperands(unsigned index) {
141 auto valueRange = getODSOperandIndexAndLength(index);
142 return {std::next(odsOperands.begin(), valueRange.first),
143 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
144 }
145
146 RangeT getArgOperands() {
147 return getODSOperands(0);
148 }
149
150 ::llvm::SmallVector<RangeT> getMapOperands() {
151 auto tblgenTmpOperands = getODSOperands(1);
152 auto sizes = getMapOpGroupSizes();
153
154 ::llvm::SmallVector<RangeT> tblgenTmpOperandGroups;
155 for (int i = 0, e = sizes.size(); i < e; ++i) {
156 tblgenTmpOperandGroups.push_back(tblgenTmpOperands.take_front(sizes[i]));
157 tblgenTmpOperands = tblgenTmpOperands.drop_front(sizes[i]);
158 }
159 return tblgenTmpOperandGroups;
160 }
161
162 RangeT getOperands() {
163 return odsOperands;
164 }
165
166private:
167 RangeT odsOperands;
168};
169class CallOpAdaptor : public CallOpGenericAdaptor<::mlir::ValueRange> {
170public:
173
174 ::mlir::LogicalResult verify(::mlir::Location loc);
175};
176class 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> {
177public:
178 using Op::Op;
179 using Op::print;
181 template <typename RangeT>
185 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
186 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("callee"), ::llvm::StringRef("mapOpGroupSizes"), ::llvm::StringRef("numDimsPerMap"), ::llvm::StringRef("operandSegmentSizes")};
187 return ::llvm::ArrayRef(attrNames);
188 }
189
190 ::mlir::StringAttr getCalleeAttrName() {
191 return getAttributeNameForIndex(0);
192 }
193
194 static ::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name) {
195 return getAttributeNameForIndex(name, 0);
196 }
197
198 ::mlir::StringAttr getMapOpGroupSizesAttrName() {
199 return getAttributeNameForIndex(1);
200 }
201
202 static ::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name) {
203 return getAttributeNameForIndex(name, 1);
204 }
205
206 ::mlir::StringAttr getNumDimsPerMapAttrName() {
207 return getAttributeNameForIndex(2);
208 }
209
210 static ::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name) {
211 return getAttributeNameForIndex(name, 2);
212 }
213
214 ::mlir::StringAttr getOperandSegmentSizesAttrName() {
215 return (*this)->getName().getAttributeNames().back();
216 }
217
218 static ::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name) {
219 return name.getAttributeNames().back();
220 }
221
222 static constexpr ::llvm::StringLiteral getOperationName() {
223 return ::llvm::StringLiteral("function.call");
224 }
225
226 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
227 ::mlir::Operation::operand_range getODSOperands(unsigned index);
228 ::mlir::Operation::operand_range getArgOperands();
229 ::mlir::OperandRangeRange getMapOperands();
230 ::mlir::MutableOperandRange getArgOperandsMutable();
231 ::mlir::MutableOperandRangeRange getMapOperandsMutable();
232 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
233 ::mlir::Operation::result_range getODSResults(unsigned index);
234 static ::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
235 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
236 static llvm::hash_code computePropertiesHash(const Properties &prop);
237 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
238 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
239 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
240 static ::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
241 static ::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
242 void writeProperties(::mlir::DialectBytecodeWriter &writer);
243 ::mlir::SymbolRefAttr getCalleeAttr();
244 ::mlir::SymbolRefAttr getCallee();
245 ::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr();
246 ::llvm::ArrayRef<int32_t> getNumDimsPerMap();
247 ::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr();
248 ::llvm::ArrayRef<int32_t> getMapOpGroupSizes();
249 void setCalleeAttr(::mlir::SymbolRefAttr attr);
250 void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr);
251 void setNumDimsPerMap(::llvm::ArrayRef<int32_t> attrValue);
252 void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr);
253 void setMapOpGroupSizes(::llvm::ArrayRef<int32_t> attrValue);
254 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::SymbolRefAttr callee, ::mlir::ValueRange argOperands = {});
255 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 = {});
256 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 = {});
257 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands = {});
258 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::llzk::function::FuncDefOp callee, ::llvm::ArrayRef<::mlir::ValueRange> mapOperands, ::mlir::DenseI32ArrayAttr numDimsPerMap, ::mlir::ValueRange argOperands = {});
259 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 = {});
260 static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties);
261 ::mlir::LogicalResult verifyInvariantsImpl();
262 ::mlir::LogicalResult verifyInvariants();
263 ::mlir::CallInterfaceCallable getCallableForCallee();
264 void setCalleeFromCallable(::mlir::CallInterfaceCallable callee);
265 ::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
266 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
267 void print(::mlir::OpAsmPrinter &_odsPrinter);
268private:
269 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
270 return getAttributeNameForIndex((*this)->getName(), index);
271 }
272
273 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
274 assert(index < 3 && "invalid attribute index");
275 assert(name.getStringRef() == getOperationName() && "invalid operation name");
276 assert(name.isRegistered() && "Operation isn't registered, missing a "
277 "dependent dialect loading?");
278 return name.getAttributeNames()[index];
279 }
280
281public:
282 ::mlir::FunctionType getCalleeType();
283
286 inline bool calleeIsCompute() { return FUNC_NAME_COMPUTE == getCallee().getLeafReference(); }
287
290 inline bool calleeIsConstrain() { return FUNC_NAME_CONSTRAIN == getCallee().getLeafReference(); }
291
294
297
300 ::mlir::Value getSelfValueFromCompute();
301
304 ::mlir::Value getSelfValueFromConstrain();
305
307 ::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp>>
308 getCalleeTarget(::mlir::SymbolTableCollection &tables);
309
312
315 static ::llvm::SmallVector<::mlir::ValueRange> toVectorOfValueRange(::mlir::OperandRangeRange);
316};
317} // namespace function
318} // namespace llzk
319MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::CallOp)
320
321namespace llzk {
322namespace function {
323
324//===----------------------------------------------------------------------===//
325// ::llzk::function::FuncDefOp declarations
326//===----------------------------------------------------------------------===//
327
328namespace detail {
330public:
331 struct Properties {
332 using arg_attrsTy = ::mlir::ArrayAttr;
334
335 auto getArgAttrs() {
336 auto &propStorage = this->arg_attrs;
337 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
338 }
339 void setArgAttrs(const ::mlir::ArrayAttr &propValue) {
340 this->arg_attrs = propValue;
341 }
342 using function_typeTy = ::mlir::TypeAttr;
344
346 auto &propStorage = this->function_type;
347 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
348 }
349 void setFunctionType(const ::mlir::TypeAttr &propValue) {
350 this->function_type = propValue;
351 }
352 using res_attrsTy = ::mlir::ArrayAttr;
354
355 auto getResAttrs() {
356 auto &propStorage = this->res_attrs;
357 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
358 }
359 void setResAttrs(const ::mlir::ArrayAttr &propValue) {
360 this->res_attrs = propValue;
361 }
362 using sym_nameTy = ::mlir::StringAttr;
364
365 auto getSymName() {
366 auto &propStorage = this->sym_name;
367 return ::llvm::cast<::mlir::StringAttr>(propStorage);
368 }
369 void setSymName(const ::mlir::StringAttr &propValue) {
370 this->sym_name = propValue;
371 }
372 bool operator==(const Properties &rhs) const {
373 return
374 rhs.arg_attrs == this->arg_attrs &&
375 rhs.function_type == this->function_type &&
376 rhs.res_attrs == this->res_attrs &&
377 rhs.sym_name == this->sym_name &&
378 true;
379 }
380 bool operator!=(const Properties &rhs) const {
381 return !(*this == rhs);
382 }
383 };
384protected:
385 ::mlir::DictionaryAttr odsAttrs;
386 ::std::optional<::mlir::OperationName> odsOpName;
388 ::mlir::RegionRange odsRegions;
389public:
390 FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {});
391
393
394 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
396 return properties;
397 }
398
399 ::mlir::DictionaryAttr getAttributes();
400 ::mlir::StringAttr getSymNameAttr();
401 ::llvm::StringRef getSymName();
402 ::mlir::TypeAttr getFunctionTypeAttr();
403 ::mlir::FunctionType getFunctionType();
404 ::mlir::ArrayAttr getArgAttrsAttr();
405 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
406 ::mlir::ArrayAttr getResAttrsAttr();
407 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
408 ::mlir::Region &getBody();
409 ::mlir::RegionRange getRegions();
410};
411} // namespace detail
412template <typename RangeT>
414 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
416public:
417 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
418
419 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FuncDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
420
421 template <typename LateInst = FuncDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, FuncDefOp>>>
422 FuncDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
423
424 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
425 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
426 }
427
428 RangeT getODSOperands(unsigned index) {
429 auto valueRange = getODSOperandIndexAndLength(index);
430 return {std::next(odsOperands.begin(), valueRange.first),
431 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
432 }
433
434 RangeT getOperands() {
435 return odsOperands;
436 }
437
438private:
439 RangeT odsOperands;
440};
441class FuncDefOpAdaptor : public FuncDefOpGenericAdaptor<::mlir::ValueRange> {
442public:
445
446 ::mlir::LogicalResult verify(::mlir::Location loc);
447};
448class 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> {
449public:
450 using Op::Op;
451 using Op::print;
453 template <typename RangeT>
457 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
458 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("arg_attrs"), ::llvm::StringRef("function_type"), ::llvm::StringRef("res_attrs"), ::llvm::StringRef("sym_name")};
459 return ::llvm::ArrayRef(attrNames);
460 }
461
462 ::mlir::StringAttr getArgAttrsAttrName() {
463 return getAttributeNameForIndex(0);
464 }
465
466 static ::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name) {
467 return getAttributeNameForIndex(name, 0);
468 }
469
470 ::mlir::StringAttr getFunctionTypeAttrName() {
471 return getAttributeNameForIndex(1);
472 }
473
474 static ::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name) {
475 return getAttributeNameForIndex(name, 1);
476 }
477
478 ::mlir::StringAttr getResAttrsAttrName() {
479 return getAttributeNameForIndex(2);
480 }
481
482 static ::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name) {
483 return getAttributeNameForIndex(name, 2);
484 }
485
486 ::mlir::StringAttr getSymNameAttrName() {
487 return getAttributeNameForIndex(3);
488 }
489
490 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
491 return getAttributeNameForIndex(name, 3);
492 }
493
494 static constexpr ::llvm::StringLiteral getOperationName() {
495 return ::llvm::StringLiteral("function.def");
496 }
497
498 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
499 ::mlir::Operation::operand_range getODSOperands(unsigned index);
500 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
501 ::mlir::Operation::result_range getODSResults(unsigned index);
502 ::mlir::Region &getBody();
503 static ::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
504 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
505 static llvm::hash_code computePropertiesHash(const Properties &prop);
506 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
507 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
508 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
509 static ::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
510 static ::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
511 void writeProperties(::mlir::DialectBytecodeWriter &writer);
512 ::mlir::StringAttr getSymNameAttr();
513 ::llvm::StringRef getSymName();
514 ::mlir::TypeAttr getFunctionTypeAttr();
515 ::mlir::FunctionType getFunctionType();
516 ::mlir::ArrayAttr getArgAttrsAttr();
517 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
518 ::mlir::ArrayAttr getResAttrsAttr();
519 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
520 void setSymNameAttr(::mlir::StringAttr attr);
521 void setSymName(::llvm::StringRef attrValue);
522 void setFunctionTypeAttr(::mlir::TypeAttr attr);
523 void setFunctionType(::mlir::FunctionType attrValue);
524 void setArgAttrsAttr(::mlir::ArrayAttr attr);
525 void setResAttrsAttr(::mlir::ArrayAttr attr);
526 ::mlir::Attribute removeArgAttrsAttr();
527 ::mlir::Attribute removeResAttrsAttr();
528 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 = {});
529 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);
530 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);
531 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);
532 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);
533 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
534 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
535 void print(::mlir::OpAsmPrinter &p);
536 ::mlir::LogicalResult verifyInvariantsImpl();
537 ::mlir::LogicalResult verifyInvariants();
538 ::mlir::LogicalResult verify();
539 ::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
540private:
541 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
542 return getAttributeNameForIndex((*this)->getName(), index);
543 }
544
545 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
546 assert(index < 4 && "invalid attribute index");
547 assert(name.getStringRef() == getOperationName() && "invalid operation name");
548 assert(name.isRegistered() && "Operation isn't registered, missing a "
549 "dependent dialect loading?");
550 return name.getAttributeNames()[index];
551 }
552
553public:
554 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
555 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {});
556 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
557 ::mlir::Operation::dialect_attr_range attrs);
558 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
559 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs,
560 ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs);
561
569 FuncDefOp clone(::mlir::IRMapping &mapper);
571
576 void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper);
577
580 return getOperation()->hasAttr(llzk::function::AllowConstraintAttr::name);
581 }
582
584 void setAllowConstraintAttr(bool newValue = true);
585
587 inline bool hasAllowWitnessAttr() {
588 return getOperation()->hasAttr(llzk::function::AllowWitnessAttr::name);
589 }
590
592 void setAllowWitnessAttr(bool newValue = true);
593
595 bool hasArgPublicAttr(unsigned index);
596
597 //===------------------------------------------------------------------===//
598 // FunctionOpInterface Methods
599 //===------------------------------------------------------------------===//
600
604 ::mlir::Region *getCallableRegion() { return isExternal() ? nullptr : &getBody(); }
605
607 ::llvm::ArrayRef<::mlir::Type> getArgumentTypes() { return getFunctionType().getInputs(); }
608
610 ::llvm::ArrayRef<::mlir::Type> getResultTypes() { return getFunctionType().getResults(); }
611
612 //===------------------------------------------------------------------===//
613 // SymbolOpInterface Methods
614 //===------------------------------------------------------------------===//
615
616 bool isDeclaration() { return isExternal(); }
617
618 //===------------------------------------------------------------------===//
619 // Utility Methods
620 //===------------------------------------------------------------------===//
621
624 ::mlir::SymbolRefAttr getFullyQualifiedName(bool requireParent = true);
625
628 inline bool nameIsCompute() { return FUNC_NAME_COMPUTE == getSymName(); }
629
632 inline bool nameIsConstrain() { return FUNC_NAME_CONSTRAIN == getSymName(); }
633
635 inline bool isInStruct() { return ::llzk::component::isInStruct(*this); }
636
638 inline bool isStructCompute() { return isInStruct() && nameIsCompute(); }
639
641 inline bool isStructConstrain() { return isInStruct() && nameIsConstrain(); }
642
645 ::mlir::Value getSelfValueFromCompute();
646
649 ::mlir::Value getSelfValueFromConstrain();
650
653};
654} // namespace function
655} // namespace llzk
656MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::FuncDefOp)
657
658namespace llzk {
659namespace function {
660
661//===----------------------------------------------------------------------===//
662// ::llzk::function::ReturnOp declarations
663//===----------------------------------------------------------------------===//
664
665namespace detail {
667public:
668protected:
669 ::mlir::DictionaryAttr odsAttrs;
670 ::std::optional<::mlir::OperationName> odsOpName;
671 ::mlir::RegionRange odsRegions;
672public:
673 ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {});
674
676
677 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
678 ::mlir::DictionaryAttr getAttributes();
679};
680} // namespace detail
681template <typename RangeT>
683 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
685public:
686 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
687
688 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ReturnOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
689
690 template <typename LateInst = ReturnOp, typename = std::enable_if_t<std::is_same_v<LateInst, ReturnOp>>>
691 ReturnOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
692
693 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
694 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
695 }
696
697 RangeT getODSOperands(unsigned index) {
698 auto valueRange = getODSOperandIndexAndLength(index);
699 return {std::next(odsOperands.begin(), valueRange.first),
700 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
701 }
702
703 RangeT getOperands() {
704 return getODSOperands(0);
705 }
706
707private:
708 RangeT odsOperands;
709};
710class ReturnOpAdaptor : public ReturnOpGenericAdaptor<::mlir::ValueRange> {
711public:
714
715 ::mlir::LogicalResult verify(::mlir::Location loc);
716};
717class 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> {
718public:
719 using Op::Op;
720 using Op::print;
722 template <typename RangeT>
725 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
726 return {};
727 }
728
729 static constexpr ::llvm::StringLiteral getOperationName() {
730 return ::llvm::StringLiteral("function.return");
731 }
732
733 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
734 ::mlir::Operation::operand_range getODSOperands(unsigned index);
735 ::mlir::Operation::operand_range getOperands();
736 ::mlir::MutableOperandRange getOperandsMutable();
737 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
738 ::mlir::Operation::result_range getODSResults(unsigned index);
739 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState);
740 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands);
741 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
742 ::mlir::LogicalResult verifyInvariantsImpl();
743 ::mlir::LogicalResult verifyInvariants();
744 ::mlir::LogicalResult verify();
745 ::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point);
746 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
747 void print(::mlir::OpAsmPrinter &_odsPrinter);
748 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
749public:
750};
751} // namespace function
752} // namespace llzk
753MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::ReturnOp)
754
755
756#endif // GET_OP_CLASSES
757
MlirStringRef name
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:191
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:129
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:136
CallOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:134
::llvm::SmallVector< RangeT > getMapOperands()
Definition Ops.h.inc:150
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:140
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:129
CallOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:131
::mlir::OperandRangeRange getMapOperands()
Definition Ops.cpp.inc:228
void setNumDimsPerMap(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:557
bool calleeIsStructConstrain()
Return true iff the callee function name is FUNC_NAME_CONSTRAIN within a StructDefOp.
Definition Ops.cpp:723
::mlir::StringAttr getOperandSegmentSizesAttrName()
Definition Ops.h.inc:214
::mlir::CallInterfaceCallable getCallableForCallee()
Return the callee of this operation.
Definition Ops.cpp:752
::mlir::FunctionType getCalleeType()
Definition Ops.cpp:694
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the callee is FUNC_NAME_COMPUTE, return the single StructType result.
Definition Ops.cpp:746
::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:663
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:434
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:385
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:643
bool calleeIsStructCompute()
Return true iff the callee function name is FUNC_NAME_COMPUTE within a StructDefOp.
Definition Ops.cpp:717
::mlir::StringAttr getNumDimsPerMapAttrName(::mlir::OperationName name)
Definition Ops.h.inc:210
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:290
static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties)
Definition Ops.cpp.inc:593
::mlir::SymbolRefAttr getCallee()
Definition Ops.cpp.inc:526
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:244
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:183
static std::optional< mlir::Attribute > getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name)
Definition Ops.cpp.inc:396
void setMapOpGroupSizesAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.cpp.inc:561
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:599
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:262
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:501
void setMapOpGroupSizes(::llvm::ArrayRef< int32_t > attrValue)
Definition Ops.cpp.inc:565
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={})
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:409
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:286
::mlir::StringAttr getCalleeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:194
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:544
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:209
::mlir::MutableOperandRange getArgOperandsMutable()
Definition Ops.cpp.inc:232
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:531
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:535
CallOpAdaptor Adaptor
Definition Ops.h.inc:180
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
Definition Ops.cpp:734
::mlir::StringAttr getMapOpGroupSizesAttrName()
Definition Ops.h.inc:198
::mlir::SymbolRefAttr getCalleeAttr()
Definition Ops.cpp.inc:522
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.cpp.inc:540
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:647
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:711
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:222
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:759
FoldAdaptor::Properties Properties
Definition Ops.h.inc:184
void setCalleeAttr(::mlir::SymbolRefAttr attr)
Definition Ops.cpp.inc:549
::mlir::StringAttr getOperandSegmentSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:218
CallOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:182
void setNumDimsPerMapAttr(::mlir::DenseI32ArrayAttr attr)
Definition Ops.cpp.inc:553
::mlir::StringAttr getNumDimsPerMapAttrName()
Definition Ops.h.inc:206
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:349
::mlir::MutableOperandRangeRange getMapOperandsMutable()
Definition Ops.cpp.inc:238
::mlir::StringAttr getMapOpGroupSizesAttrName(::mlir::OperationName name)
Definition Ops.h.inc:202
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:268
::mlir::StringAttr getCalleeAttrName()
Definition Ops.h.inc:190
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:443
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:464
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:185
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
Definition Ops.cpp:729
::mlir::Operation::operand_range getArgOperands()
Definition Ops.cpp.inc:224
void setCalleeFromCallable(::mlir::CallInterfaceCallable callee)
Set the callee for this operation.
Definition Ops.cpp:755
::mlir::FailureOr<::llzk::SymbolLookupResult<::llzk::function::FuncDefOp > > getCalleeTarget(::mlir::SymbolTableCollection &tables)
Resolve and return the target FuncDefOp for this CallOp.
Definition Ops.cpp:739
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:218
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:806
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:417
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:424
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:428
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:417
FuncDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:422
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:419
::mlir::ArrayAttr getArgAttrsAttr()
Definition Ops.cpp.inc:1100
::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:474
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:482
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:832
static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value)
Definition Ops.cpp.inc:997
void setAllowWitnessAttr(bool newValue=true)
Add (resp. remove) the allow_witness attribute to (resp. from) the function def.
Definition Ops.cpp:195
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:974
FoldAdaptor::Properties Properties
Definition Ops.h.inc:456
::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:289
::mlir::Value getSelfValueFromCompute()
Return the "self" value (i.e.
Definition Ops.cpp:314
::mlir::FunctionType getFunctionType()
Definition Ops.cpp.inc:1095
void setArgAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.cpp.inc:1134
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:486
::llvm::ArrayRef<::mlir::Type > getArgumentTypes()
Returns the argument types of this function.
Definition Ops.h.inc:607
::mlir::Attribute removeArgAttrsAttr()
Definition Ops.cpp.inc:1142
::mlir::StringAttr getSymNameAttr()
Definition Ops.cpp.inc:1082
void setSymNameAttr(::mlir::StringAttr attr)
Definition Ops.cpp.inc:1118
::mlir::StringAttr getFunctionTypeAttrName()
Definition Ops.h.inc:470
::mlir::Value getSelfValueFromConstrain()
Return the "self" value (i.e.
Definition Ops.cpp:333
FuncDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:454
::mlir::TypeAttr getFunctionTypeAttr()
Definition Ops.cpp.inc:1091
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:982
void print(::mlir::OpAsmPrinter &p)
Definition Ops.cpp:106
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1245
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:628
::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:1029
bool hasAllowWitnessAttr()
Return true iff the function def has the allow_witness attribute.
Definition Ops.h.inc:587
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:842
FuncDefOpAdaptor Adaptor
Definition Ops.h.inc:452
void setResAttrsAttr(::mlir::ArrayAttr attr)
Definition Ops.cpp.inc:1138
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the name is FUNC_NAME_COMPUTE, return the single StructType result.
Definition Ops.cpp:338
::mlir::StringAttr getResAttrsAttrName()
Definition Ops.h.inc:478
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:1113
::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:466
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp:95
void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper)
Clone the internal blocks and attributes from this function into dest.
Definition Ops.cpp:115
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:1104
::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state)
Definition Ops.cpp.inc:1056
::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop)
Definition Ops.cpp.inc:937
static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs)
Definition Ops.cpp.inc:1019
void writeProperties(::mlir::DialectBytecodeWriter &writer)
Definition Ops.cpp.inc:1072
::llvm::StringRef getSymName()
Definition Ops.cpp.inc:1086
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:632
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:638
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:828
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1216
bool isInStruct()
Return true iff the function is within a StructDefOp.
Definition Ops.h.inc:635
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:838
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:490
::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError)
Definition Ops.cpp.inc:852
::mlir::Attribute removeResAttrsAttr()
Definition Ops.cpp.inc:1148
void setFunctionType(::mlir::FunctionType attrValue)
Definition Ops.cpp.inc:1130
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:457
::llvm::ArrayRef<::mlir::Type > getResultTypes()
Returns the result types of this function.
Definition Ops.h.inc:610
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:494
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:455
bool isStructConstrain()
Return true iff the function is within a StructDefOp and named FUNC_NAME_CONSTRAIN.
Definition Ops.h.inc:641
void setAllowConstraintAttr(bool newValue=true)
Add (resp. remove) the allow_constraint attribute to (resp. from) the function def.
Definition Ops.cpp:187
void setSymName(::llvm::StringRef attrValue)
Definition Ops.cpp.inc:1122
::mlir::Region & getBody()
Definition Ops.cpp.inc:848
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:304
bool hasArgPublicAttr(unsigned index)
Return true iff the argument at the given index has pub attribute.
Definition Ops.cpp:203
::mlir::Region * getCallableRegion()
Returns the region on the current operation that is callable.
Definition Ops.h.inc:604
::mlir::ArrayAttr getResAttrsAttr()
Definition Ops.cpp.inc:1109
::mlir::LogicalResult verify()
Definition Ops.cpp:213
bool hasAllowConstraintAttr()
Return true iff the function def has the allow_constraint attribute.
Definition Ops.h.inc:579
void setFunctionTypeAttr(::mlir::TypeAttr attr)
Definition Ops.cpp.inc:1126
::mlir::StringAttr getArgAttrsAttrName()
Definition Ops.h.inc:462
::mlir::LogicalResult verify(::mlir::Location loc)
Definition Ops.cpp.inc:1294
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:686
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:686
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:688
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:697
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:693
ReturnOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:691
void print(::mlir::OpAsmPrinter &_odsPrinter)
Definition Ops.cpp.inc:1403
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1298
::mlir::LogicalResult verifyInvariants()
Definition Ops.cpp.inc:1371
static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState)
Definition Ops.cpp.inc:1342
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:724
::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point)
Definition Ops.cpp.inc:1418
::mlir::Operation::operand_range getODSOperands(unsigned index)
Definition Ops.cpp.inc:1316
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:1332
static ::llvm::ArrayRef<::llvm::StringRef > getAttributeNames()
Definition Ops.h.inc:725
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1415
::mlir::LogicalResult verify()
Definition Ops.cpp:347
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1358
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:729
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:1336
ReturnOpAdaptor Adaptor
Definition Ops.h.inc:721
::mlir::Operation::operand_range getOperands()
Definition Ops.cpp.inc:1322
::mlir::MutableOperandRange getOperandsMutable()
Definition Ops.cpp.inc:1326
ReturnOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:723
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp.inc:1377
::llvm::ArrayRef< int32_t > getMapOpGroupSizes()
Definition Ops.cpp.inc:183
::mlir::DenseI32ArrayAttr getNumDimsPerMapAttr()
Definition Ops.cpp.inc:168
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:102
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:145
::mlir::DenseI32ArrayAttr getMapOpGroupSizesAttr()
Definition Ops.cpp.inc:178
::llvm::ArrayRef< int32_t > getNumDimsPerMap()
Definition Ops.cpp.inc:173
CallOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:139
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:790
::std::optional< ::mlir::ArrayAttr > getArgAttrs()
Definition Ops.cpp.inc:780
FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:741
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:747
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:386
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:670
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize)
Definition Ops.cpp.inc:1269
ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.cpp.inc:1263
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
void setOperandSegmentSizes(const ::llvm::ArrayRef< int32_t > &propValue)
Definition Ops.h.inc:84
void setNumDimsPerMap(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:75
void setMapOpGroupSizes(const ::mlir::DenseI32ArrayAttr &propValue)
Definition Ops.h.inc:65
void setCallee(const ::mlir::SymbolRefAttr &propValue)
Definition Ops.h.inc:55
void setResAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:359
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:369
void setArgAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:339
void setFunctionType(const ::mlir::TypeAttr &propValue)
Definition Ops.h.inc:349