LLZK 2.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
Ops.capi.test.cpp.inc
Go to the documentation of this file.
1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Op C API Tests *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* From: Ops.td *|
7|* *|
8\*===----------------------------------------------------------------------===*/
9
10class FunctionOperationLinkTests : public CAPITest {};
11
13TEST_F(FunctionOperationLinkTests, IsA_Function_CallOp) {
14 auto testOperation = createIndexOperation();
15
16 // This will always return false since `createIndex*` returns an MLIR builtin
17 EXPECT_FALSE(llzkOperationIsA_Function_CallOp(testOperation));
18
19 mlirOperationDestroy(testOperation);
20}
21
22TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetArgOperandsCount) {
23 auto testOp = createIndexOperation();
24
27 }
28
29 mlirOperationDestroy(testOp);
30}
31
32TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetArgOperandsAt) {
33 auto testOp = createIndexOperation();
34
37 }
38
39 mlirOperationDestroy(testOp);
40}
41
42TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetArgOperands_Variadic) {
43 auto testOp = createIndexOperation();
44
46 auto dummyValue = mlirOperationGetResult(testOp, 0);
47 MlirValue values[] = {dummyValue};
48 llzkFunction_CallOpSetArgOperands(testOp, 1, values);
49 }
50
51 mlirOperationDestroy(testOp);
52}
53
54TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetMapOperandsCount) {
55 auto testOp = createIndexOperation();
56
59 }
60
61 mlirOperationDestroy(testOp);
62}
63
64TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetMapOperandsAt) {
65 auto testOp = createIndexOperation();
66
69 }
70
71 mlirOperationDestroy(testOp);
72}
73
74TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetMapOperands_Variadic) {
75 auto testOp = createIndexOperation();
76
78 auto dummyValue = mlirOperationGetResult(testOp, 0);
79 MlirValue values[] = {dummyValue};
80 llzkFunction_CallOpSetMapOperands(testOp, 1, values);
81 }
82
83 mlirOperationDestroy(testOp);
84}
85
86TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetCalleeAttr) {
87 auto testOp = createIndexOperation();
88
90 (void)llzkFunction_CallOpGetCallee(testOp);
91 }
92
93 mlirOperationDestroy(testOp);
94}
95
96TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetCalleeAttr) {
97 auto testOp = createIndexOperation();
98
100 llzkFunction_CallOpSetCallee(testOp, createIndexAttribute());
101 }
102
103 mlirOperationDestroy(testOp);
104}
105
106TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetTemplateParamsAttr) {
107 auto testOp = createIndexOperation();
108
111 }
112
113 mlirOperationDestroy(testOp);
114}
115
116TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetTemplateParamsAttr) {
117 auto testOp = createIndexOperation();
118
120 llzkFunction_CallOpSetTemplateParams(testOp, createIndexAttribute());
121 }
122
123 mlirOperationDestroy(testOp);
124}
125
126TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetNumDimsPerMapAttr) {
127 auto testOp = createIndexOperation();
128
131 }
132
133 mlirOperationDestroy(testOp);
134}
135
136TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetNumDimsPerMapAttr) {
137 auto testOp = createIndexOperation();
138
140 llzkFunction_CallOpSetNumDimsPerMap(testOp, createIndexAttribute());
141 }
142
143 mlirOperationDestroy(testOp);
144}
145
146TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetMapOpGroupSizesAttr) {
147 auto testOp = createIndexOperation();
148
151 }
152
153 mlirOperationDestroy(testOp);
154}
155
156TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetMapOpGroupSizesAttr) {
157 auto testOp = createIndexOperation();
158
160 llzkFunction_CallOpSetMapOpGroupSizes(testOp, createIndexAttribute());
161 }
162
163 mlirOperationDestroy(testOp);
164}
165
166TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetResult0Count) {
167 auto testOp = createIndexOperation();
168
171 }
172
173 mlirOperationDestroy(testOp);
174}
175
176TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetResult0At) {
177 auto testOp = createIndexOperation();
178
180 (void)llzkFunction_CallOpGetResult0At(testOp, 0);
181 }
182
183 mlirOperationDestroy(testOp);
184}
185
187TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeContainsWitnessGen) {
188 auto testOperation = createIndexOperation();
189
190 if (llzkOperationIsA_Function_CallOp(testOperation)) {
191
193 }
194
195 mlirOperationDestroy(testOperation);
196}
197
199TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsStructCompute) {
200 auto testOperation = createIndexOperation();
201
202 if (llzkOperationIsA_Function_CallOp(testOperation)) {
203
204 (void)llzkFunction_CallOpCalleeIsStructCompute(testOperation);
205 }
206
207 mlirOperationDestroy(testOperation);
208}
209
211TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSingleResultTypeOfCompute) {
212 auto testOperation = createIndexOperation();
213
214 if (llzkOperationIsA_Function_CallOp(testOperation)) {
215
217 }
218
219 mlirOperationDestroy(testOperation);
220}
221
223TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsStructConstrain) {
224 auto testOperation = createIndexOperation();
225
226 if (llzkOperationIsA_Function_CallOp(testOperation)) {
227
229 }
230
231 mlirOperationDestroy(testOperation);
232}
233
235TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSelfValueFromConstrain) {
236 auto testOperation = createIndexOperation();
237
238 if (llzkOperationIsA_Function_CallOp(testOperation)) {
239
241 }
242
243 mlirOperationDestroy(testOperation);
244}
245
247TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetTypeSignature) {
248 auto testOperation = createIndexOperation();
249
250 if (llzkOperationIsA_Function_CallOp(testOperation)) {
251
252 (void)llzkFunction_CallOpGetTypeSignature(testOperation);
253 }
254
255 mlirOperationDestroy(testOperation);
256}
257
259TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsCompute) {
260 auto testOperation = createIndexOperation();
261
262 if (llzkOperationIsA_Function_CallOp(testOperation)) {
263
264 (void)llzkFunction_CallOpCalleeIsCompute(testOperation);
265 }
266
267 mlirOperationDestroy(testOperation);
268}
269
271TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsConstrain) {
272 auto testOperation = createIndexOperation();
273
274 if (llzkOperationIsA_Function_CallOp(testOperation)) {
275
276 (void)llzkFunction_CallOpCalleeIsConstrain(testOperation);
277 }
278
279 mlirOperationDestroy(testOperation);
280}
281
283TEST_F(FunctionOperationLinkTests, llzk_CallOp_ResolveCallable) {
284 auto testOperation = createIndexOperation();
285
286 if (llzkOperationIsA_Function_CallOp(testOperation)) {
287
288 (void)llzkFunction_CallOpResolveCallable(testOperation);
289 }
290
291 mlirOperationDestroy(testOperation);
292}
293
295TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSelfValueFromCompute) {
296 auto testOperation = createIndexOperation();
297
298 if (llzkOperationIsA_Function_CallOp(testOperation)) {
299
301 }
302
303 mlirOperationDestroy(testOperation);
304}
305
307TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSingleResultTypeOfWitnessGen) {
308 auto testOperation = createIndexOperation();
309
310 if (llzkOperationIsA_Function_CallOp(testOperation)) {
311
313 }
314
315 mlirOperationDestroy(testOperation);
316}
317
319TEST_F(FunctionOperationLinkTests, IsA_Function_FuncDefOp) {
320 auto testOperation = createIndexOperation();
321
322 // This will always return false since `createIndex*` returns an MLIR builtin
323 EXPECT_FALSE(llzkOperationIsA_Function_FuncDefOp(testOperation));
324
325 mlirOperationDestroy(testOperation);
326}
327
329TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_Build) {
330 // Returns an `arith.constant` op, which will never match the FuncDefOp dialect check.
331 auto testOp = createIndexOperation();
332
333 // This condition is always false, so the function is never actually called.
334 // We only verify it compiles and links correctly.
336 MlirOpBuilder builder = mlirOpBuilderCreate(context);
337 MlirLocation location = mlirLocationUnknownGet(context);
338 auto dummyValue = mlirOperationGetResult(testOp, 0);
339 auto sym_nameAttr = mlirOperationGetName(testOp);
340 auto function_typeAttr = createIndexAttribute();
341 auto arg_attrsAttr = createIndexAttribute();
342 auto res_attrsAttr = createIndexAttribute();
343
344 (void)llzkFunction_FuncDefOpBuild(builder, location, sym_nameAttr, function_typeAttr, arg_attrsAttr, res_attrsAttr);
345 // No need to destroy builder or op since this code never runs.
346 }
347
348 mlirOperationDestroy(testOp);
349}
350
351struct FuncDefOpBuildFuncHelper : public TestAnyBuildFuncHelper<CAPITest> {
352 virtual bool callIsA(MlirOperation op) override { return llzkOperationIsA_Function_FuncDefOp(op); }
356 static std::unique_ptr<FuncDefOpBuildFuncHelper> get();
357
358protected:
360};
361
364TEST_F(CAPITest, FuncDefOp_build_pass) { FuncDefOpBuildFuncHelper::get()->run(*this); }
365
366TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSymNameAttr) {
367 auto testOp = createIndexOperation();
368
371 }
372
373 mlirOperationDestroy(testOp);
374}
375
376TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetSymNameAttr) {
377 auto testOp = createIndexOperation();
378
380 llzkFunction_FuncDefOpSetSymName(testOp, createIndexAttribute());
381 }
382
383 mlirOperationDestroy(testOp);
384}
385
386TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetFunctionTypeAttr) {
387 auto testOp = createIndexOperation();
388
391 }
392
393 mlirOperationDestroy(testOp);
394}
395
396TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetFunctionTypeAttr) {
397 auto testOp = createIndexOperation();
398
400 llzkFunction_FuncDefOpSetFunctionType(testOp, createIndexAttribute());
401 }
402
403 mlirOperationDestroy(testOp);
404}
405
406TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetArgAttrsAttr) {
407 auto testOp = createIndexOperation();
408
411 }
412
413 mlirOperationDestroy(testOp);
414}
415
416TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetArgAttrsAttr) {
417 auto testOp = createIndexOperation();
418
420 llzkFunction_FuncDefOpSetArgAttrs(testOp, createIndexAttribute());
421 }
422
423 mlirOperationDestroy(testOp);
424}
425
426TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetResAttrsAttr) {
427 auto testOp = createIndexOperation();
428
431 }
432
433 mlirOperationDestroy(testOp);
434}
435
436TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetResAttrsAttr) {
437 auto testOp = createIndexOperation();
438
440 llzkFunction_FuncDefOpSetResAttrs(testOp, createIndexAttribute());
441 }
442
443 mlirOperationDestroy(testOp);
444}
445
446TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetBodyRegion) {
447 auto testOp = createIndexOperation();
448
450 (void)llzkFunction_FuncDefOpGetBody(testOp);
451 }
452
453 mlirOperationDestroy(testOp);
454}
455
457TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetFullyQualifiedName) {
458 auto testOperation = createIndexOperation();
459
460 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
461 bool requireParent = false;
462
463 (void)llzkFunction_FuncDefOpGetFullyQualifiedName(testOperation, requireParent);
464 }
465
466 mlirOperationDestroy(testOperation);
467}
468
470TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowNonNativeFieldOpsAttr) {
471 auto testOperation = createIndexOperation();
472
473 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
474 bool newValue = false;
475
476 (void)llzkFunction_FuncDefOpSetAllowNonNativeFieldOpsAttr(testOperation, newValue);
477 }
478
479 mlirOperationDestroy(testOperation);
480}
481
483TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsDeclaration) {
484 auto testOperation = createIndexOperation();
485
486 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
487
488 (void)llzkFunction_FuncDefOpIsDeclaration(testOperation);
489 }
490
491 mlirOperationDestroy(testOperation);
492}
493
495TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowNonNativeFieldOpsAttr) {
496 auto testOperation = createIndexOperation();
497
498 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
499
501 }
502
503 mlirOperationDestroy(testOperation);
504}
505
507TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsProduct) {
508 auto testOperation = createIndexOperation();
509
510 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
511
512 (void)llzkFunction_FuncDefOpNameIsProduct(testOperation);
513 }
514
515 mlirOperationDestroy(testOperation);
516}
517
519TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasArgPublicAttr) {
520 auto testOperation = createIndexOperation();
521
522 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
523 unsigned index = 0;
524
525 (void)llzkFunction_FuncDefOpHasArgPublicAttr(testOperation, index);
526 }
527
528 mlirOperationDestroy(testOperation);
529}
530
532TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructProduct) {
533 auto testOperation = createIndexOperation();
534
535 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
536
537 (void)llzkFunction_FuncDefOpIsStructProduct(testOperation);
538 }
539
540 mlirOperationDestroy(testOperation);
541}
542
544TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSelfValueFromConstrain) {
545 auto testOperation = createIndexOperation();
546
547 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
548
550 }
551
552 mlirOperationDestroy(testOperation);
553}
554
556TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSingleResultTypeOfCompute) {
557 auto testOperation = createIndexOperation();
558
559 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
560
562 }
563
564 mlirOperationDestroy(testOperation);
565}
566
568TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowWitnessAttr) {
569 auto testOperation = createIndexOperation();
570
571 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
572
574 }
575
576 mlirOperationDestroy(testOperation);
577}
578
580TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsConstrain) {
581 auto testOperation = createIndexOperation();
582
583 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
584
585 (void)llzkFunction_FuncDefOpNameIsConstrain(testOperation);
586 }
587
588 mlirOperationDestroy(testOperation);
589}
590
592TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetCallableRegion) {
593 auto testOperation = createIndexOperation();
594
595 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
596
597 (void)llzkFunction_FuncDefOpGetCallableRegion(testOperation);
598 }
599
600 mlirOperationDestroy(testOperation);
601}
602
604TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowConstraintAttr) {
605 auto testOperation = createIndexOperation();
606
607 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
608 bool newValue = false;
609
610 (void)llzkFunction_FuncDefOpSetAllowConstraintAttr(testOperation, newValue);
611 }
612
613 mlirOperationDestroy(testOperation);
614}
615
617TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSelfValueFromCompute) {
618 auto testOperation = createIndexOperation();
619
620 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
621
623 }
624
625 mlirOperationDestroy(testOperation);
626}
627
629TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowConstraintAttr) {
630 auto testOperation = createIndexOperation();
631
632 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
633
635 }
636
637 mlirOperationDestroy(testOperation);
638}
639
641TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsInStruct) {
642 auto testOperation = createIndexOperation();
643
644 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
645
646 (void)llzkFunction_FuncDefOpIsInStruct(testOperation);
647 }
648
649 mlirOperationDestroy(testOperation);
650}
651
653TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowWitnessAttr) {
654 auto testOperation = createIndexOperation();
655
656 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
657 bool newValue = false;
658
659 (void)llzkFunction_FuncDefOpSetAllowWitnessAttr(testOperation, newValue);
660 }
661
662 mlirOperationDestroy(testOperation);
663}
664
666TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsCompute) {
667 auto testOperation = createIndexOperation();
668
669 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
670
671 (void)llzkFunction_FuncDefOpNameIsCompute(testOperation);
672 }
673
674 mlirOperationDestroy(testOperation);
675}
676
678TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructConstrain) {
679 auto testOperation = createIndexOperation();
680
681 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
682
683 (void)llzkFunction_FuncDefOpIsStructConstrain(testOperation);
684 }
685
686 mlirOperationDestroy(testOperation);
687}
688
690TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructCompute) {
691 auto testOperation = createIndexOperation();
692
693 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
694
695 (void)llzkFunction_FuncDefOpIsStructCompute(testOperation);
696 }
697
698 mlirOperationDestroy(testOperation);
699}
700
702TEST_F(FunctionOperationLinkTests, IsA_Function_ReturnOp) {
703 auto testOperation = createIndexOperation();
704
705 // This will always return false since `createIndex*` returns an MLIR builtin
706 EXPECT_FALSE(llzkOperationIsA_Function_ReturnOp(testOperation));
707
708 mlirOperationDestroy(testOperation);
709}
710
712TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_Build) {
713 // Returns an `arith.constant` op, which will never match the ReturnOp dialect check.
714 auto testOp = createIndexOperation();
715
716 // This condition is always false, so the function is never actually called.
717 // We only verify it compiles and links correctly.
719 MlirOpBuilder builder = mlirOpBuilderCreate(context);
720 MlirLocation location = mlirLocationUnknownGet(context);
721 auto dummyValue = mlirOperationGetResult(testOp, 0);
722 MlirValue operandsValues[] = {dummyValue};
723 intptr_t operandsSize = 0;
724
725 (void)llzkFunction_ReturnOpBuild(builder, location, operandsSize, operandsValues);
726 // No need to destroy builder or op since this code never runs.
727 }
728
729 mlirOperationDestroy(testOp);
730}
731
732struct ReturnOpBuildFuncHelper : public TestAnyBuildFuncHelper<CAPITest> {
733 virtual bool callIsA(MlirOperation op) override { return llzkOperationIsA_Function_ReturnOp(op); }
737 static std::unique_ptr<ReturnOpBuildFuncHelper> get();
738
739protected:
741};
742
745TEST_F(CAPITest, ReturnOp_build_pass) { ReturnOpBuildFuncHelper::get()->run(*this); }
746
747TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_GetOperandsCount) {
748 auto testOp = createIndexOperation();
749
752 }
753
754 mlirOperationDestroy(testOp);
755}
756
757TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_GetOperandsAt) {
758 auto testOp = createIndexOperation();
759
761 (void)llzkFunction_ReturnOpGetOperandsAt(testOp, 0);
762 }
763
764 mlirOperationDestroy(testOp);
765}
766
767TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_SetOperands_Variadic) {
768 auto testOp = createIndexOperation();
769
771 auto dummyValue = mlirOperationGetResult(testOp, 0);
772 MlirValue values[] = {dummyValue};
773 llzkFunction_ReturnOpSetOperands(testOp, 1, values);
774 }
775
776 mlirOperationDestroy(testOp);
777}
TEST_F(ArrayOperationLinkTests, IsA_Array_ArrayLengthOp)
This test ensures llzkOperationIsA_Array_ArrayLengthOp links properly.
MlirOpBuilder mlirOpBuilderCreate(MlirContext ctx)
Creates a new OpBuilder for the given MLIR context.
Definition Builder.cpp:62
bool llzkFunction_FuncDefOpNameIsProduct(MlirOperation inp)
Return true iff the function name is FUNC_NAME_PRODUCT (if needed, a check that this FuncDefOp is loc...
MlirRegion llzkFunction_FuncDefOpGetCallableRegion(MlirOperation inp)
Required by FunctionOpInterface.
void llzkFunction_FuncDefOpSetResAttrs(MlirOperation op, MlirAttribute attr)
Set ResAttrs attribute of llzk::function::FuncDefOp Operation.
MlirOperation llzkFunction_FuncDefOpBuild(MlirOpBuilder builder, MlirLocation location, MlirIdentifier sym_name, MlirAttribute function_type, MlirAttribute arg_attrs, MlirAttribute res_attrs)
Build a llzk::function::FuncDefOp Operation.
void llzkFunction_CallOpSetMapOperands(MlirOperation op, intptr_t count, MlirValue const *values)
Set MapOperands operands of llzk::function::CallOp Operation.
MlirValue llzkFunction_ReturnOpGetOperandsAt(MlirOperation op, intptr_t index)
Get Operands operand at index from llzk::function::ReturnOp Operation.
bool llzkFunction_FuncDefOpIsStructProduct(MlirOperation inp)
Return true iff the function is within a StructDefOp and named FUNC_NAME_PRODUCT.
intptr_t llzkFunction_CallOpGetResult0Count(MlirOperation op)
Get number of Result0 results in llzk::function::CallOp Operation.
MlirAttribute llzkFunction_FuncDefOpGetFullyQualifiedName(MlirOperation inp, bool requireParent)
Return the full name for this function from the root module, including all surrounding symbol table n...
bool llzkFunction_CallOpCalleeIsStructConstrain(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_CONSTRAIN within a StructDefOp.
void llzkFunction_FuncDefOpSetFunctionType(MlirOperation op, MlirAttribute attr)
Set FunctionType attribute of llzk::function::FuncDefOp Operation.
MlirAttribute llzkFunction_CallOpGetMapOpGroupSizes(MlirOperation op)
Get MapOpGroupSizes attribute from llzk::function::CallOp Operation.
bool llzkFunction_CallOpCalleeIsCompute(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_COMPUTE (this does not check if the callee func...
MlirAttribute llzkFunction_CallOpGetTemplateParams(MlirOperation op)
Get TemplateParams attribute from llzk::function::CallOp Operation.
intptr_t llzkFunction_CallOpGetMapOperandsCount(MlirOperation op)
Get number of MapOperands operands in llzk::function::CallOp Operation.
intptr_t llzkFunction_CallOpGetArgOperandsCount(MlirOperation op)
Get number of ArgOperands operands in llzk::function::CallOp Operation.
void llzkFunction_ReturnOpSetOperands(MlirOperation op, intptr_t count, MlirValue const *values)
Set Operands operands of llzk::function::ReturnOp Operation.
bool llzkFunction_FuncDefOpHasAllowWitnessAttr(MlirOperation inp)
Return true iff the function def has the allow_witness attribute.
MlirValue llzkFunction_FuncDefOpGetSelfValueFromConstrain(MlirOperation inp)
Return the "self" value (i.e.
MlirAttribute llzkFunction_FuncDefOpGetResAttrs(MlirOperation op)
Get ResAttrs attribute from llzk::function::FuncDefOp Operation.
MlirType llzkFunction_CallOpGetSingleResultTypeOfCompute(MlirOperation inp)
Assuming the callee is FUNC_NAME_COMPUTE, return the single StructType result.
MlirOperation llzkFunction_ReturnOpBuild(MlirOpBuilder builder, MlirLocation location, intptr_t operandsSize, MlirValue const *operands)
Build a llzk::function::ReturnOp Operation.
bool llzkFunction_FuncDefOpIsDeclaration(MlirOperation inp)
Required by SymbolOpInterface.
void llzkFunction_CallOpSetCallee(MlirOperation op, MlirAttribute attr)
Set Callee attribute of llzk::function::CallOp Operation.
bool llzkFunction_CallOpCalleeContainsWitnessGen(MlirOperation inp)
Return true iff the callee function can contain witness generation code (this does not check if the c...
bool llzkFunction_FuncDefOpHasAllowConstraintAttr(MlirOperation inp)
Return true iff the function def has the allow_constraint attribute.
bool llzkFunction_FuncDefOpIsInStruct(MlirOperation inp)
Return true iff the function is within a StructDefOp.
void llzkFunction_FuncDefOpSetArgAttrs(MlirOperation op, MlirAttribute attr)
Set ArgAttrs attribute of llzk::function::FuncDefOp Operation.
void llzkFunction_FuncDefOpSetAllowConstraintAttr(MlirOperation inp, bool newValue)
Add (resp. remove) the allow_constraint attribute to (resp. from) the function def.
void llzkFunction_CallOpSetArgOperands(MlirOperation op, intptr_t count, MlirValue const *values)
Set ArgOperands operands of llzk::function::CallOp Operation.
MlirValue llzkFunction_CallOpGetSelfValueFromConstrain(MlirOperation inp)
Return the "self" value (i.e.
bool llzkFunction_FuncDefOpHasArgPublicAttr(MlirOperation inp, unsigned index)
Return true iff the argument at the given index has pub attribute.
void llzkFunction_FuncDefOpSetAllowNonNativeFieldOpsAttr(MlirOperation inp, bool newValue)
Add (resp. remove) the allow_non_native_field_ops attribute to (resp. from) the function def.
bool llzkFunction_FuncDefOpIsStructConstrain(MlirOperation inp)
Return true iff the function is within a StructDefOp and named FUNC_NAME_CONSTRAIN.
MlirValue llzkFunction_CallOpGetArgOperandsAt(MlirOperation op, intptr_t index)
Get ArgOperands operand at index from llzk::function::CallOp Operation.
MlirType llzkFunction_FuncDefOpGetSingleResultTypeOfCompute(MlirOperation inp)
Assuming the name is FUNC_NAME_COMPUTE, return the single StructType result.
void llzkFunction_CallOpSetTemplateParams(MlirOperation op, MlirAttribute attr)
Set TemplateParams attribute of llzk::function::CallOp Operation.
void llzkFunction_CallOpSetNumDimsPerMap(MlirOperation op, MlirAttribute attr)
Set NumDimsPerMap attribute of llzk::function::CallOp Operation.
bool llzkOperationIsA_Function_ReturnOp(MlirOperation inp)
Returns true if the Operation is a llzk::function::ReturnOp.
bool llzkOperationIsA_Function_CallOp(MlirOperation inp)
Returns true if the Operation is a llzk::function::CallOp.
MlirAttribute llzkFunction_CallOpGetCallee(MlirOperation op)
Get Callee attribute from llzk::function::CallOp Operation.
MlirType llzkFunction_CallOpGetSingleResultTypeOfWitnessGen(MlirOperation inp)
Assuming the callee contains witness generation code, return the single StructType result.
MlirAttribute llzkFunction_FuncDefOpGetArgAttrs(MlirOperation op)
Get ArgAttrs attribute from llzk::function::FuncDefOp Operation.
bool llzkFunction_FuncDefOpNameIsConstrain(MlirOperation inp)
Return true iff the function name is FUNC_NAME_CONSTRAIN (if needed, a check that this FuncDefOp is l...
MlirValue llzkFunction_FuncDefOpGetSelfValueFromCompute(MlirOperation inp)
Return the "self" value (i.e.
bool llzkFunction_FuncDefOpIsStructCompute(MlirOperation inp)
Return true iff the function is within a StructDefOp and named FUNC_NAME_COMPUTE.
void llzkFunction_FuncDefOpSetAllowWitnessAttr(MlirOperation inp, bool newValue)
Add (resp. remove) the allow_witness attribute to (resp. from) the function def.
intptr_t llzkFunction_ReturnOpGetOperandsCount(MlirOperation op)
Get number of Operands operands in llzk::function::ReturnOp Operation.
MlirValue llzkFunction_CallOpGetMapOperandsAt(MlirOperation op, intptr_t index)
Get MapOperands operand at index from llzk::function::CallOp Operation.
bool llzkFunction_FuncDefOpHasAllowNonNativeFieldOpsAttr(MlirOperation inp)
Return true iff the function def has the allow_non_native_field_ops attribute.
void llzkFunction_FuncDefOpSetSymName(MlirOperation op, MlirAttribute attr)
Set SymName attribute of llzk::function::FuncDefOp Operation.
MlirRegion llzkFunction_FuncDefOpGetBody(MlirOperation op)
Get Body region from llzk::function::FuncDefOp Operation.
MlirType llzkFunction_CallOpGetTypeSignature(MlirOperation inp)
Return the FunctionType inferred from the arg operands and result types of this CallOp.
MlirValue llzkFunction_CallOpGetSelfValueFromCompute(MlirOperation inp)
Return the "self" value (i.e.
bool llzkFunction_CallOpCalleeIsStructCompute(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_COMPUTE within a StructDefOp.
MlirAttribute llzkFunction_FuncDefOpGetFunctionType(MlirOperation op)
Get FunctionType attribute from llzk::function::FuncDefOp Operation.
MlirValue llzkFunction_CallOpGetResult0At(MlirOperation op, intptr_t index)
Get Result0 result at index from llzk::function::CallOp Operation.
MlirOperation llzkFunction_CallOpResolveCallable(MlirOperation inp)
Required by CallOpInterface.
bool llzkFunction_FuncDefOpNameIsCompute(MlirOperation inp)
Return true iff the function name is FUNC_NAME_COMPUTE (if needed, a check that this FuncDefOp is loc...
bool llzkOperationIsA_Function_FuncDefOp(MlirOperation inp)
Returns true if the Operation is a llzk::function::FuncDefOp.
void llzkFunction_CallOpSetMapOpGroupSizes(MlirOperation op, MlirAttribute attr)
Set MapOpGroupSizes attribute of llzk::function::CallOp Operation.
MlirAttribute llzkFunction_CallOpGetNumDimsPerMap(MlirOperation op)
Get NumDimsPerMap attribute from llzk::function::CallOp Operation.
MlirAttribute llzkFunction_FuncDefOpGetSymName(MlirOperation op)
Get SymName attribute from llzk::function::FuncDefOp Operation.
bool llzkFunction_CallOpCalleeIsConstrain(MlirOperation inp)
Return true iff the callee function name is FUNC_NAME_CONSTRAIN (this does not check if the callee fu...
static std::unique_ptr< FuncDefOpBuildFuncHelper > get()
This method must be implemented to return a subclass of FuncDefOpBuildFuncHelper that at least implem...
virtual bool callIsA(MlirOperation op) override
FuncDefOpBuildFuncHelper()=default
ReturnOpBuildFuncHelper()=default
static std::unique_ptr< ReturnOpBuildFuncHelper > get()
This method must be implemented to return a subclass of ReturnOpBuildFuncHelper that at least impleme...
virtual bool callIsA(MlirOperation op) override