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