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, ::llzk::function::FuncDefOp callee, ::mlir::ValueRange argOperands = {});
256 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 = {});
257 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 = {});
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};
301} // namespace function
302} // namespace llzk
303MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::CallOp)
304
305namespace llzk {
306namespace function {
307
308//===----------------------------------------------------------------------===//
309// ::llzk::function::FuncDefOp declarations
310//===----------------------------------------------------------------------===//
311
312namespace detail {
314public:
315 struct Properties {
316 using arg_attrsTy = ::mlir::ArrayAttr;
318
319 auto getArgAttrs() {
320 auto &propStorage = this->arg_attrs;
321 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
322 }
323 void setArgAttrs(const ::mlir::ArrayAttr &propValue) {
324 this->arg_attrs = propValue;
325 }
326 using function_typeTy = ::mlir::TypeAttr;
328
330 auto &propStorage = this->function_type;
331 return ::llvm::cast<::mlir::TypeAttr>(propStorage);
332 }
333 void setFunctionType(const ::mlir::TypeAttr &propValue) {
334 this->function_type = propValue;
335 }
336 using res_attrsTy = ::mlir::ArrayAttr;
338
339 auto getResAttrs() {
340 auto &propStorage = this->res_attrs;
341 return ::llvm::dyn_cast_or_null<::mlir::ArrayAttr>(propStorage);
342 }
343 void setResAttrs(const ::mlir::ArrayAttr &propValue) {
344 this->res_attrs = propValue;
345 }
346 using sym_nameTy = ::mlir::StringAttr;
348
349 auto getSymName() {
350 auto &propStorage = this->sym_name;
351 return ::llvm::cast<::mlir::StringAttr>(propStorage);
352 }
353 void setSymName(const ::mlir::StringAttr &propValue) {
354 this->sym_name = propValue;
355 }
356 bool operator==(const Properties &rhs) const {
357 return
358 rhs.arg_attrs == this->arg_attrs &&
359 rhs.function_type == this->function_type &&
360 rhs.res_attrs == this->res_attrs &&
361 rhs.sym_name == this->sym_name &&
362 true;
363 }
364 bool operator!=(const Properties &rhs) const {
365 return !(*this == rhs);
366 }
367 };
368protected:
369 ::mlir::DictionaryAttr odsAttrs;
370 ::std::optional<::mlir::OperationName> odsOpName;
372 ::mlir::RegionRange odsRegions;
373public:
374 FuncDefOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {});
375
377
378 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
380 return properties;
381 }
382
383 ::mlir::DictionaryAttr getAttributes();
384 ::mlir::StringAttr getSymNameAttr();
385 ::llvm::StringRef getSymName();
386 ::mlir::TypeAttr getFunctionTypeAttr();
387 ::mlir::FunctionType getFunctionType();
388 ::mlir::ArrayAttr getArgAttrsAttr();
389 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
390 ::mlir::ArrayAttr getResAttrsAttr();
391 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
392 ::mlir::Region &getBody();
393 ::mlir::RegionRange getRegions();
394};
395} // namespace detail
396template <typename RangeT>
398 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
400public:
401 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const Properties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
402
403 FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : FuncDefOpGenericAdaptor(values, attrs, (properties ? *properties.as<Properties *>() : Properties{}), regions) {}
404
405 template <typename LateInst = FuncDefOp, typename = std::enable_if_t<std::is_same_v<LateInst, FuncDefOp>>>
406 FuncDefOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
407
408 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
409 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
410 }
411
412 RangeT getODSOperands(unsigned index) {
413 auto valueRange = getODSOperandIndexAndLength(index);
414 return {std::next(odsOperands.begin(), valueRange.first),
415 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
416 }
417
418 RangeT getOperands() {
419 return odsOperands;
420 }
421
422private:
423 RangeT odsOperands;
424};
425class FuncDefOpAdaptor : public FuncDefOpGenericAdaptor<::mlir::ValueRange> {
426public:
429
430 ::mlir::LogicalResult verify(::mlir::Location loc);
431};
432class 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> {
433public:
434 using Op::Op;
435 using Op::print;
437 template <typename RangeT>
441 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
442 static ::llvm::StringRef attrNames[] = {::llvm::StringRef("arg_attrs"), ::llvm::StringRef("function_type"), ::llvm::StringRef("res_attrs"), ::llvm::StringRef("sym_name")};
443 return ::llvm::ArrayRef(attrNames);
444 }
445
446 ::mlir::StringAttr getArgAttrsAttrName() {
447 return getAttributeNameForIndex(0);
448 }
449
450 static ::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name) {
451 return getAttributeNameForIndex(name, 0);
452 }
453
454 ::mlir::StringAttr getFunctionTypeAttrName() {
455 return getAttributeNameForIndex(1);
456 }
457
458 static ::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name) {
459 return getAttributeNameForIndex(name, 1);
460 }
461
462 ::mlir::StringAttr getResAttrsAttrName() {
463 return getAttributeNameForIndex(2);
464 }
465
466 static ::mlir::StringAttr getResAttrsAttrName(::mlir::OperationName name) {
467 return getAttributeNameForIndex(name, 2);
468 }
469
470 ::mlir::StringAttr getSymNameAttrName() {
471 return getAttributeNameForIndex(3);
472 }
473
474 static ::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name) {
475 return getAttributeNameForIndex(name, 3);
476 }
477
478 static constexpr ::llvm::StringLiteral getOperationName() {
479 return ::llvm::StringLiteral("function.def");
480 }
481
482 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
483 ::mlir::Operation::operand_range getODSOperands(unsigned index);
484 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
485 ::mlir::Operation::result_range getODSResults(unsigned index);
486 ::mlir::Region &getBody();
487 static ::mlir::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
488 static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop);
489 static llvm::hash_code computePropertiesHash(const Properties &prop);
490 static std::optional<mlir::Attribute> getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name);
491 static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value);
492 static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs);
493 static ::mlir::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError);
494 static ::mlir::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state);
495 void writeProperties(::mlir::DialectBytecodeWriter &writer);
496 ::mlir::StringAttr getSymNameAttr();
497 ::llvm::StringRef getSymName();
498 ::mlir::TypeAttr getFunctionTypeAttr();
499 ::mlir::FunctionType getFunctionType();
500 ::mlir::ArrayAttr getArgAttrsAttr();
501 ::std::optional< ::mlir::ArrayAttr > getArgAttrs();
502 ::mlir::ArrayAttr getResAttrsAttr();
503 ::std::optional< ::mlir::ArrayAttr > getResAttrs();
504 void setSymNameAttr(::mlir::StringAttr attr);
505 void setSymName(::llvm::StringRef attrValue);
506 void setFunctionTypeAttr(::mlir::TypeAttr attr);
507 void setFunctionType(::mlir::FunctionType attrValue);
508 void setArgAttrsAttr(::mlir::ArrayAttr attr);
509 void setResAttrsAttr(::mlir::ArrayAttr attr);
510 ::mlir::Attribute removeArgAttrsAttr();
511 ::mlir::Attribute removeResAttrsAttr();
512 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 = {});
513 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);
514 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);
515 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);
516 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);
517 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
518 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
519 void print(::mlir::OpAsmPrinter &p);
520 ::mlir::LogicalResult verifyInvariantsImpl();
521 ::mlir::LogicalResult verifyInvariants();
522 ::mlir::LogicalResult verify();
523 ::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable);
524private:
525 ::mlir::StringAttr getAttributeNameForIndex(unsigned index) {
526 return getAttributeNameForIndex((*this)->getName(), index);
527 }
528
529 static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) {
530 assert(index < 4 && "invalid attribute index");
531 assert(name.getStringRef() == getOperationName() && "invalid operation name");
532 assert(name.isRegistered() && "Operation isn't registered, missing a "
533 "dependent dialect loading?");
534 return name.getAttributeNames()[index];
535 }
536
537public:
538 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
539 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs = {});
540 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
541 ::mlir::Operation::dialect_attr_range attrs);
542 static FuncDefOp create(::mlir::Location location, ::llvm::StringRef name, ::mlir::FunctionType type,
543 ::llvm::ArrayRef<::mlir::NamedAttribute> attrs,
544 ::llvm::ArrayRef<::mlir::DictionaryAttr> argAttrs);
545
553 FuncDefOp clone(::mlir::IRMapping &mapper);
555
560 void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper);
561
564 return getOperation()->hasAttr(llzk::function::AllowConstraintAttr::name);
565 }
566
568 void setAllowConstraintAttr(bool newValue = true);
569
571 inline bool hasAllowWitnessAttr() {
572 return getOperation()->hasAttr(llzk::function::AllowWitnessAttr::name);
573 }
574
576 void setAllowWitnessAttr(bool newValue = true);
577
579 bool hasArgPublicAttr(unsigned index);
580
581 //===------------------------------------------------------------------===//
582 // FunctionOpInterface Methods
583 //===------------------------------------------------------------------===//
584
588 ::mlir::Region *getCallableRegion() { return isExternal() ? nullptr : &getBody(); }
589
591 ::llvm::ArrayRef<::mlir::Type> getArgumentTypes() { return getFunctionType().getInputs(); }
592
594 ::llvm::ArrayRef<::mlir::Type> getResultTypes() { return getFunctionType().getResults(); }
595
596 //===------------------------------------------------------------------===//
597 // SymbolOpInterface Methods
598 //===------------------------------------------------------------------===//
599
600 bool isDeclaration() { return isExternal(); }
601
602 //===------------------------------------------------------------------===//
603 // Utility Methods
604 //===------------------------------------------------------------------===//
605
608 ::mlir::SymbolRefAttr getFullyQualifiedName();
609
612 inline bool nameIsCompute() { return FUNC_NAME_COMPUTE == getSymName(); }
613
616 inline bool nameIsConstrain() { return FUNC_NAME_CONSTRAIN == getSymName(); }
617
619 bool isInStruct() { return ::llzk::component::isInStruct(*this); }
620
622 inline bool isStructCompute() { return isInStruct() && nameIsCompute(); }
623
625 inline bool isStructConstrain() { return isInStruct() && nameIsConstrain(); }
626
629};
630} // namespace function
631} // namespace llzk
632MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::FuncDefOp)
633
634namespace llzk {
635namespace function {
636
637//===----------------------------------------------------------------------===//
638// ::llzk::function::ReturnOp declarations
639//===----------------------------------------------------------------------===//
640
641namespace detail {
643public:
644protected:
645 ::mlir::DictionaryAttr odsAttrs;
646 ::std::optional<::mlir::OperationName> odsOpName;
647 ::mlir::RegionRange odsRegions;
648public:
649 ReturnOpGenericAdaptorBase(::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {});
650
652
653 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize);
654 ::mlir::DictionaryAttr getAttributes();
655};
656} // namespace detail
657template <typename RangeT>
659 using ValueT = ::llvm::detail::ValueOfRange<RangeT>;
661public:
662 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr, const ::mlir::EmptyProperties &properties = {}, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {}
663
664 ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions = {}) : ReturnOpGenericAdaptor(values, attrs, (properties ? *properties.as<::mlir::EmptyProperties *>() : ::mlir::EmptyProperties{}), regions) {}
665
666 template <typename LateInst = ReturnOp, typename = std::enable_if_t<std::is_same_v<LateInst, ReturnOp>>>
667 ReturnOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {}
668
669 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index) {
670 return Base::getODSOperandIndexAndLength(index, odsOperands.size());
671 }
672
673 RangeT getODSOperands(unsigned index) {
674 auto valueRange = getODSOperandIndexAndLength(index);
675 return {std::next(odsOperands.begin(), valueRange.first),
676 std::next(odsOperands.begin(), valueRange.first + valueRange.second)};
677 }
678
679 RangeT getOperands() {
680 return getODSOperands(0);
681 }
682
683private:
684 RangeT odsOperands;
685};
686class ReturnOpAdaptor : public ReturnOpGenericAdaptor<::mlir::ValueRange> {
687public:
690
691 ::mlir::LogicalResult verify(::mlir::Location loc);
692};
693class 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> {
694public:
695 using Op::Op;
696 using Op::print;
698 template <typename RangeT>
701 static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() {
702 return {};
703 }
704
705 static constexpr ::llvm::StringLiteral getOperationName() {
706 return ::llvm::StringLiteral("function.return");
707 }
708
709 std::pair<unsigned, unsigned> getODSOperandIndexAndLength(unsigned index);
710 ::mlir::Operation::operand_range getODSOperands(unsigned index);
711 ::mlir::Operation::operand_range getOperands();
712 ::mlir::MutableOperandRange getOperandsMutable();
713 std::pair<unsigned, unsigned> getODSResultIndexAndLength(unsigned index);
714 ::mlir::Operation::result_range getODSResults(unsigned index);
715 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState);
716 static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands);
717 static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {});
718 ::mlir::LogicalResult verifyInvariantsImpl();
719 ::mlir::LogicalResult verifyInvariants();
720 ::mlir::LogicalResult verify();
721 ::mlir::MutableOperandRange getMutableSuccessorOperands(::mlir::RegionBranchPoint point);
722 static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result);
723 void print(::mlir::OpAsmPrinter &_odsPrinter);
724 void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects);
725public:
726};
727} // namespace function
728} // namespace llzk
729MLIR_DECLARE_EXPLICIT_TYPE_ID(::llzk::function::ReturnOp)
730
731
732#endif // GET_OP_CLASSES
733
::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:694
::mlir::StringAttr getOperandSegmentSizesAttrName()
Definition Ops.h.inc:214
::mlir::CallInterfaceCallable getCallableForCallee()
Return the callee of this operation.
Definition Ops.cpp:706
::mlir::FunctionType getCalleeType()
Definition Ops.cpp:665
::llzk::component::StructType getSingleResultTypeOfCompute()
Assuming the callee is FUNC_NAME_COMPUTE, return the single StructType result.
Definition Ops.cpp:700
::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:634
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:688
::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::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
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::Operation::operand_range getArgOperands()
Definition Ops.cpp.inc:224
void setCalleeFromCallable(::mlir::CallInterfaceCallable callee)
Set the callee for this operation.
Definition Ops.cpp:709
::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:401
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:408
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:412
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const Properties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:401
FuncDefOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:406
FuncDefOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:403
::mlir::ArrayAttr getArgAttrsAttr()
Definition Ops.cpp.inc:1100
::mlir::StringAttr getFunctionTypeAttrName(::mlir::OperationName name)
Definition Ops.h.inc:458
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:466
::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:194
static llvm::hash_code computePropertiesHash(const Properties &prop)
Definition Ops.cpp.inc:974
FoldAdaptor::Properties Properties
Definition Ops.h.inc:440
::mlir::LogicalResult verifySymbolUses(::mlir::SymbolTableCollection &symbolTable)
Definition Ops.cpp:288
::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:470
::llvm::ArrayRef<::mlir::Type > getArgumentTypes()
Returns the argument types of this function.
Definition Ops.h.inc:591
::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:454
FuncDefOpGenericAdaptor< RangeT > GenericAdaptor
Definition Ops.h.inc:438
::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:105
::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:612
::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:571
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:842
FuncDefOpAdaptor Adaptor
Definition Ops.h.inc:436
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:309
::mlir::StringAttr getResAttrsAttrName()
Definition Ops.h.inc:462
::std::optional< ::mlir::ArrayAttr > getResAttrs()
Definition Ops.cpp.inc:1113
::mlir::StringAttr getArgAttrsAttrName(::mlir::OperationName name)
Definition Ops.h.inc:450
::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result)
Definition Ops.cpp:94
void cloneInto(FuncDefOp dest, ::mlir::IRMapping &mapper)
Clone the internal blocks and attributes from this function into dest.
Definition Ops.cpp:114
::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:616
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:622
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:619
std::pair< unsigned, unsigned > getODSResultIndexAndLength(unsigned index)
Definition Ops.cpp.inc:838
::mlir::StringAttr getSymNameAttrName(::mlir::OperationName name)
Definition Ops.h.inc:474
::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:441
::llvm::ArrayRef<::mlir::Type > getResultTypes()
Returns the result types of this function.
Definition Ops.h.inc:594
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:478
GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute > > FoldAdaptor
Definition Ops.h.inc:439
bool isStructConstrain()
Return true iff the function is within a StructDefOp and named FUNC_NAME_CONSTRAIN.
Definition Ops.h.inc:625
void setAllowConstraintAttr(bool newValue=true)
Add (resp. remove) the allow_constraint attribute to (resp. from) the function def.
Definition Ops.cpp:186
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={})
bool hasArgPublicAttr(unsigned index)
Return true iff the argument at the given index has pub attribute.
Definition Ops.cpp:202
::mlir::Region * getCallableRegion()
Returns the region on the current operation that is callable.
Definition Ops.h.inc:588
::mlir::ArrayAttr getResAttrsAttr()
Definition Ops.cpp.inc:1109
::mlir::LogicalResult verify()
Definition Ops.cpp:212
::mlir::SymbolRefAttr getFullyQualifiedName()
Return the full name for this function from the root module, including all surrounding symbol table n...
Definition Ops.cpp:303
bool hasAllowConstraintAttr()
Return true iff the function def has the allow_constraint attribute.
Definition Ops.h.inc:563
void setFunctionTypeAttr(::mlir::TypeAttr attr)
Definition Ops.cpp.inc:1126
::mlir::StringAttr getArgAttrsAttrName()
Definition Ops.h.inc:446
::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:662
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs=nullptr, const ::mlir::EmptyProperties &properties={}, ::mlir::RegionRange regions={})
Definition Ops.h.inc:662
ReturnOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::OpaqueProperties properties, ::mlir::RegionRange regions={})
Definition Ops.h.inc:664
RangeT getODSOperands(unsigned index)
Definition Ops.h.inc:673
std::pair< unsigned, unsigned > getODSOperandIndexAndLength(unsigned index)
Definition Ops.h.inc:669
ReturnOpGenericAdaptor(RangeT values, LateInst op)
Definition Ops.h.inc:667
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:700
::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:701
void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect > > &effects)
Definition Ops.cpp.inc:1415
::mlir::LogicalResult verify()
Definition Ops.cpp:318
::mlir::LogicalResult verifyInvariantsImpl()
Definition Ops.cpp.inc:1358
static constexpr ::llvm::StringLiteral getOperationName()
Definition Ops.h.inc:705
::mlir::Operation::result_range getODSResults(unsigned index)
Definition Ops.cpp.inc:1336
ReturnOpAdaptor Adaptor
Definition Ops.h.inc:697
::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:699
::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:370
::std::optional<::mlir::OperationName > odsOpName
Definition Ops.h.inc:646
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:343
void setSymName(const ::mlir::StringAttr &propValue)
Definition Ops.h.inc:353
void setArgAttrs(const ::mlir::ArrayAttr &propValue)
Definition Ops.h.inc:323
void setFunctionType(const ::mlir::TypeAttr &propValue)
Definition Ops.h.inc:333