LLZK 2.1.1
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_VariadicOfVariadic) {
75 auto testOp = createIndexOperation();
76
78 auto dummyValue = mlirOperationGetResult(testOp, 0);
79 MlirValueRange groups[1];
80 groups[0].values = &dummyValue;
81 groups[0].size = 1;
82 llzkFunction_CallOpSetMapOperands(testOp, 1, groups);
83 }
84
85 mlirOperationDestroy(testOp);
86}
87
88TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetCalleeAttr) {
89 auto testOp = createIndexOperation();
90
92 (void)llzkFunction_CallOpGetCallee(testOp);
93 }
94
95 mlirOperationDestroy(testOp);
96}
97
98TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetCalleeAttr) {
99 auto testOp = createIndexOperation();
100
102 llzkFunction_CallOpSetCallee(testOp, createIndexAttribute());
103 }
104
105 mlirOperationDestroy(testOp);
106}
107
108TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetTemplateParamsAttr) {
109 auto testOp = createIndexOperation();
110
113 }
114
115 mlirOperationDestroy(testOp);
116}
117
118TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetTemplateParamsAttr) {
119 auto testOp = createIndexOperation();
120
122 llzkFunction_CallOpSetTemplateParams(testOp, createIndexAttribute());
123 }
124
125 mlirOperationDestroy(testOp);
126}
127
128TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetNumDimsPerMapAttr) {
129 auto testOp = createIndexOperation();
130
133 }
134
135 mlirOperationDestroy(testOp);
136}
137
138TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetNumDimsPerMapAttr) {
139 auto testOp = createIndexOperation();
140
142 llzkFunction_CallOpSetNumDimsPerMap(testOp, createIndexAttribute());
143 }
144
145 mlirOperationDestroy(testOp);
146}
147
148TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetMapOpGroupSizesAttr) {
149 auto testOp = createIndexOperation();
150
153 }
154
155 mlirOperationDestroy(testOp);
156}
157
158TEST_F(FunctionOperationLinkTests, llzk_CallOp_SetMapOpGroupSizesAttr) {
159 auto testOp = createIndexOperation();
160
162 llzkFunction_CallOpSetMapOpGroupSizes(testOp, createIndexAttribute());
163 }
164
165 mlirOperationDestroy(testOp);
166}
167
168TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetResult0Count) {
169 auto testOp = createIndexOperation();
170
173 }
174
175 mlirOperationDestroy(testOp);
176}
177
178TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetResult0At) {
179 auto testOp = createIndexOperation();
180
182 (void)llzkFunction_CallOpGetResult0At(testOp, 0);
183 }
184
185 mlirOperationDestroy(testOp);
186}
187
189TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeContainsWitnessGen) {
190 auto testOperation = createIndexOperation();
191
192 if (llzkOperationIsA_Function_CallOp(testOperation)) {
193
195 }
196
197 mlirOperationDestroy(testOperation);
198}
199
201TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsStructCompute) {
202 auto testOperation = createIndexOperation();
203
204 if (llzkOperationIsA_Function_CallOp(testOperation)) {
205
206 (void)llzkFunction_CallOpCalleeIsStructCompute(testOperation);
207 }
208
209 mlirOperationDestroy(testOperation);
210}
211
213TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSingleResultTypeOfCompute) {
214 auto testOperation = createIndexOperation();
215
216 if (llzkOperationIsA_Function_CallOp(testOperation)) {
217
219 }
220
221 mlirOperationDestroy(testOperation);
222}
223
225TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsStructConstrain) {
226 auto testOperation = createIndexOperation();
227
228 if (llzkOperationIsA_Function_CallOp(testOperation)) {
229
231 }
232
233 mlirOperationDestroy(testOperation);
234}
235
237TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSelfValueFromConstrain) {
238 auto testOperation = createIndexOperation();
239
240 if (llzkOperationIsA_Function_CallOp(testOperation)) {
241
243 }
244
245 mlirOperationDestroy(testOperation);
246}
247
249TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetTypeSignature) {
250 auto testOperation = createIndexOperation();
251
252 if (llzkOperationIsA_Function_CallOp(testOperation)) {
253
254 (void)llzkFunction_CallOpGetTypeSignature(testOperation);
255 }
256
257 mlirOperationDestroy(testOperation);
258}
259
261TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsCompute) {
262 auto testOperation = createIndexOperation();
263
264 if (llzkOperationIsA_Function_CallOp(testOperation)) {
265
266 (void)llzkFunction_CallOpCalleeIsCompute(testOperation);
267 }
268
269 mlirOperationDestroy(testOperation);
270}
271
273TEST_F(FunctionOperationLinkTests, llzk_CallOp_CalleeIsConstrain) {
274 auto testOperation = createIndexOperation();
275
276 if (llzkOperationIsA_Function_CallOp(testOperation)) {
277
278 (void)llzkFunction_CallOpCalleeIsConstrain(testOperation);
279 }
280
281 mlirOperationDestroy(testOperation);
282}
283
285TEST_F(FunctionOperationLinkTests, llzk_CallOp_ResolveCallable) {
286 auto testOperation = createIndexOperation();
287
288 if (llzkOperationIsA_Function_CallOp(testOperation)) {
289
290 (void)llzkFunction_CallOpResolveCallable(testOperation);
291 }
292
293 mlirOperationDestroy(testOperation);
294}
295
297TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSelfValueFromCompute) {
298 auto testOperation = createIndexOperation();
299
300 if (llzkOperationIsA_Function_CallOp(testOperation)) {
301
303 }
304
305 mlirOperationDestroy(testOperation);
306}
307
309TEST_F(FunctionOperationLinkTests, llzk_CallOp_GetSingleResultTypeOfWitnessGen) {
310 auto testOperation = createIndexOperation();
311
312 if (llzkOperationIsA_Function_CallOp(testOperation)) {
313
315 }
316
317 mlirOperationDestroy(testOperation);
318}
319
321TEST_F(FunctionOperationLinkTests, IsA_Function_FuncDefOp) {
322 auto testOperation = createIndexOperation();
323
324 // This will always return false since `createIndex*` returns an MLIR builtin
325 EXPECT_FALSE(llzkOperationIsA_Function_FuncDefOp(testOperation));
326
327 mlirOperationDestroy(testOperation);
328}
329
331TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_Build) {
332 // Returns an `arith.constant` op, which will never match the FuncDefOp dialect check.
333 auto testOp = createIndexOperation();
334
335 // This condition is always false, so the function is never actually called.
336 // We only verify it compiles and links correctly.
338 MlirOpBuilder builder = mlirOpBuilderCreate(context);
339 MlirLocation location = mlirLocationUnknownGet(context);
340 auto dummyValue = mlirOperationGetResult(testOp, 0);
341 auto sym_nameAttr = mlirOperationGetName(testOp);
342 auto function_typeAttr = createIndexAttribute();
343 auto arg_attrsAttr = createIndexAttribute();
344 auto res_attrsAttr = createIndexAttribute();
345
346 (void)llzkFunction_FuncDefOpBuild(builder, location, sym_nameAttr, function_typeAttr, arg_attrsAttr, res_attrsAttr);
347 // No need to destroy builder or op since this code never runs.
348 }
349
350 mlirOperationDestroy(testOp);
351}
352
353struct FuncDefOpBuildFuncHelper : public TestAnyBuildFuncHelper<CAPITest> {
354 virtual bool callIsA(MlirOperation op) override { return llzkOperationIsA_Function_FuncDefOp(op); }
358 static std::unique_ptr<FuncDefOpBuildFuncHelper> get();
359
360protected:
362};
363
366TEST_F(CAPITest, FuncDefOp_build_pass) { FuncDefOpBuildFuncHelper::get()->run(*this); }
367
368TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSymNameAttr) {
369 auto testOp = createIndexOperation();
370
373 }
374
375 mlirOperationDestroy(testOp);
376}
377
378TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetSymNameAttr) {
379 auto testOp = createIndexOperation();
380
382 llzkFunction_FuncDefOpSetSymName(testOp, createIndexAttribute());
383 }
384
385 mlirOperationDestroy(testOp);
386}
387
388TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetFunctionTypeAttr) {
389 auto testOp = createIndexOperation();
390
393 }
394
395 mlirOperationDestroy(testOp);
396}
397
398TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetFunctionTypeAttr) {
399 auto testOp = createIndexOperation();
400
402 llzkFunction_FuncDefOpSetFunctionType(testOp, createIndexAttribute());
403 }
404
405 mlirOperationDestroy(testOp);
406}
407
408TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetArgAttrsAttr) {
409 auto testOp = createIndexOperation();
410
413 }
414
415 mlirOperationDestroy(testOp);
416}
417
418TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetArgAttrsAttr) {
419 auto testOp = createIndexOperation();
420
422 llzkFunction_FuncDefOpSetArgAttrs(testOp, createIndexAttribute());
423 }
424
425 mlirOperationDestroy(testOp);
426}
427
428TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetResAttrsAttr) {
429 auto testOp = createIndexOperation();
430
433 }
434
435 mlirOperationDestroy(testOp);
436}
437
438TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetResAttrsAttr) {
439 auto testOp = createIndexOperation();
440
442 llzkFunction_FuncDefOpSetResAttrs(testOp, createIndexAttribute());
443 }
444
445 mlirOperationDestroy(testOp);
446}
447
448TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetBodyRegion) {
449 auto testOp = createIndexOperation();
450
452 (void)llzkFunction_FuncDefOpGetBody(testOp);
453 }
454
455 mlirOperationDestroy(testOp);
456}
457
459TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructProduct) {
460 auto testOperation = createIndexOperation();
461
462 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
463
464 (void)llzkFunction_FuncDefOpIsStructProduct(testOperation);
465 }
466
467 mlirOperationDestroy(testOperation);
468}
469
471TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowNonNativeFieldOpsAttr) {
472 auto testOperation = createIndexOperation();
473
474 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
475 bool newValue = false;
476
477 (void)llzkFunction_FuncDefOpSetAllowNonNativeFieldOpsAttr(testOperation, newValue);
478 }
479
480 mlirOperationDestroy(testOperation);
481}
482
484TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowNonNativeFieldOpsAttr) {
485 auto testOperation = createIndexOperation();
486
487 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
488
490 }
491
492 mlirOperationDestroy(testOperation);
493}
494
496TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsProduct) {
497 auto testOperation = createIndexOperation();
498
499 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
500
501 (void)llzkFunction_FuncDefOpNameIsProduct(testOperation);
502 }
503
504 mlirOperationDestroy(testOperation);
505}
506
508TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasArgPublicAttr) {
509 auto testOperation = createIndexOperation();
510
511 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
512 unsigned index = 0;
513
514 (void)llzkFunction_FuncDefOpHasArgPublicAttr(testOperation, index);
515 }
516
517 mlirOperationDestroy(testOperation);
518}
519
521TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowWitnessAttr) {
522 auto testOperation = createIndexOperation();
523
524 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
525
527 }
528
529 mlirOperationDestroy(testOperation);
530}
531
533TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructConstrain) {
534 auto testOperation = createIndexOperation();
535
536 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
537
538 (void)llzkFunction_FuncDefOpIsStructConstrain(testOperation);
539 }
540
541 mlirOperationDestroy(testOperation);
542}
543
545TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsCompute) {
546 auto testOperation = createIndexOperation();
547
548 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
549
550 (void)llzkFunction_FuncDefOpNameIsCompute(testOperation);
551 }
552
553 mlirOperationDestroy(testOperation);
554}
555
557TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsDeclaration) {
558 auto testOperation = createIndexOperation();
559
560 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
561
562 (void)llzkFunction_FuncDefOpIsDeclaration(testOperation);
563 }
564
565 mlirOperationDestroy(testOperation);
566}
567
569TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSingleResultTypeOfCompute) {
570 auto testOperation = createIndexOperation();
571
572 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
573
575 }
576
577 mlirOperationDestroy(testOperation);
578}
579
581TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSelfValueFromConstrain) {
582 auto testOperation = createIndexOperation();
583
584 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
585
587 }
588
589 mlirOperationDestroy(testOperation);
590}
591
593TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_NameIsConstrain) {
594 auto testOperation = createIndexOperation();
595
596 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
597
598 (void)llzkFunction_FuncDefOpNameIsConstrain(testOperation);
599 }
600
601 mlirOperationDestroy(testOperation);
602}
603
605TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsStructCompute) {
606 auto testOperation = createIndexOperation();
607
608 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
609
610 (void)llzkFunction_FuncDefOpIsStructCompute(testOperation);
611 }
612
613 mlirOperationDestroy(testOperation);
614}
615
617TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetCallableRegion) {
618 auto testOperation = createIndexOperation();
619
620 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
621
622 (void)llzkFunction_FuncDefOpGetCallableRegion(testOperation);
623 }
624
625 mlirOperationDestroy(testOperation);
626}
627
629TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowConstraintAttr) {
630 auto testOperation = createIndexOperation();
631
632 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
633 bool newValue = false;
634
635 (void)llzkFunction_FuncDefOpSetAllowConstraintAttr(testOperation, newValue);
636 }
637
638 mlirOperationDestroy(testOperation);
639}
640
642TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasAllowConstraintAttr) {
643 auto testOperation = createIndexOperation();
644
645 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
646
648 }
649
650 mlirOperationDestroy(testOperation);
651}
652
654TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_IsInStruct) {
655 auto testOperation = createIndexOperation();
656
657 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
658
659 (void)llzkFunction_FuncDefOpIsInStruct(testOperation);
660 }
661
662 mlirOperationDestroy(testOperation);
663}
664
666TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_SetAllowWitnessAttr) {
667 auto testOperation = createIndexOperation();
668
669 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
670 bool newValue = false;
671
672 (void)llzkFunction_FuncDefOpSetAllowWitnessAttr(testOperation, newValue);
673 }
674
675 mlirOperationDestroy(testOperation);
676}
677
679TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetSelfValueFromCompute) {
680 auto testOperation = createIndexOperation();
681
682 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
683
685 }
686
687 mlirOperationDestroy(testOperation);
688}
689
691TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_HasArgName) {
692 auto testOperation = createIndexOperation();
693
694 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
695 unsigned index = 0;
696
697 (void)llzkFunction_FuncDefOpHasArgName(testOperation, index);
698 }
699
700 mlirOperationDestroy(testOperation);
701}
702
704TEST_F(FunctionOperationLinkTests, llzk_FuncDefOp_GetFullyQualifiedName) {
705 auto testOperation = createIndexOperation();
706
707 if (llzkOperationIsA_Function_FuncDefOp(testOperation)) {
708 bool requireParent = false;
709
710 (void)llzkFunction_FuncDefOpGetFullyQualifiedName(testOperation, requireParent);
711 }
712
713 mlirOperationDestroy(testOperation);
714}
715
717TEST_F(FunctionOperationLinkTests, IsA_Function_ReturnOp) {
718 auto testOperation = createIndexOperation();
719
720 // This will always return false since `createIndex*` returns an MLIR builtin
721 EXPECT_FALSE(llzkOperationIsA_Function_ReturnOp(testOperation));
722
723 mlirOperationDestroy(testOperation);
724}
725
727TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_Build) {
728 // Returns an `arith.constant` op, which will never match the ReturnOp dialect check.
729 auto testOp = createIndexOperation();
730
731 // This condition is always false, so the function is never actually called.
732 // We only verify it compiles and links correctly.
734 MlirOpBuilder builder = mlirOpBuilderCreate(context);
735 MlirLocation location = mlirLocationUnknownGet(context);
736 auto dummyValue = mlirOperationGetResult(testOp, 0);
737 MlirValue operandsValues[] = {dummyValue};
738 intptr_t operandsSize = 0;
739
740 (void)llzkFunction_ReturnOpBuild(builder, location, operandsSize, operandsValues);
741 // No need to destroy builder or op since this code never runs.
742 }
743
744 mlirOperationDestroy(testOp);
745}
746
747struct ReturnOpBuildFuncHelper : public TestAnyBuildFuncHelper<CAPITest> {
748 virtual bool callIsA(MlirOperation op) override { return llzkOperationIsA_Function_ReturnOp(op); }
752 static std::unique_ptr<ReturnOpBuildFuncHelper> get();
753
754protected:
756};
757
760TEST_F(CAPITest, ReturnOp_build_pass) { ReturnOpBuildFuncHelper::get()->run(*this); }
761
762TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_GetOperandsCount) {
763 auto testOp = createIndexOperation();
764
767 }
768
769 mlirOperationDestroy(testOp);
770}
771
772TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_GetOperandsAt) {
773 auto testOp = createIndexOperation();
774
776 (void)llzkFunction_ReturnOpGetOperandsAt(testOp, 0);
777 }
778
779 mlirOperationDestroy(testOp);
780}
781
782TEST_F(FunctionOperationLinkTests, llzk_ReturnOp_SetOperands_Variadic) {
783 auto testOp = createIndexOperation();
784
786 auto dummyValue = mlirOperationGetResult(testOp, 0);
787 MlirValue values[] = {dummyValue};
788 llzkFunction_ReturnOpSetOperands(testOp, 1, values);
789 }
790
791 mlirOperationDestroy(testOp);
792}
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:78
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.
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_CallOpSetMapOperands(MlirOperation op, intptr_t groupCount, MlirValueRange const *groups)
Set MapOperands operand groups of 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.
bool llzkFunction_FuncDefOpHasArgName(MlirOperation inp, unsigned index)
Return true iff the argument at the given index has a function.arg_name attribute.
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
Representation of an mlir::ValueRange
Definition Support.h:47
MlirValue const * values
Pointer to the first value in the range.
Definition Support.h:49
intptr_t size
Number of values in the range.
Definition Support.h:51
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