LLZK 0.1.0
Veridise's ZK Language IR
Loading...
Searching...
No Matches
AnalysisPasses.h.inc
Go to the documentation of this file.
1/* Autogenerated by mlir-tblgen; don't manually edit */
2
3#ifdef GEN_PASS_DECL
4// Generate declarations for all passes.
5#define GEN_PASS_DECL_CALLGRAPHPRINTERPASS
6#define GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
7#define GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
8#define GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
9#undef GEN_PASS_DECL
10#endif // GEN_PASS_DECL
11
12//===----------------------------------------------------------------------===//
13// CallGraphPrinterPass
14//===----------------------------------------------------------------------===//
15#ifdef GEN_PASS_DECL_CALLGRAPHPRINTERPASS
16#undef GEN_PASS_DECL_CALLGRAPHPRINTERPASS
17#endif // GEN_PASS_DECL_CALLGRAPHPRINTERPASS
18#ifdef GEN_PASS_DEF_CALLGRAPHPRINTERPASS
19namespace impl {
20
21template <typename DerivedT>
22class CallGraphPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
23public:
24 using Base = CallGraphPrinterPassBase;
25
26 CallGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
27 CallGraphPrinterPassBase(const CallGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
28
30 static constexpr ::llvm::StringLiteral getArgumentName() {
31 return ::llvm::StringLiteral("llzk-print-call-graph");
32 }
33 ::llvm::StringRef getArgument() const override { return "llzk-print-call-graph"; }
34
35 ::llvm::StringRef getDescription() const override { return "Print the LLZK module's call graph."; }
36
38 static constexpr ::llvm::StringLiteral getPassName() {
39 return ::llvm::StringLiteral("CallGraphPrinterPass");
40 }
41 ::llvm::StringRef getName() const override { return "CallGraphPrinterPass"; }
42
44 static bool classof(const ::mlir::Pass *pass) {
45 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
46 }
47
49 std::unique_ptr<::mlir::Pass> clonePass() const override {
50 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
51 }
52
54 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
55 registry.insert<llzk::LLZKDialect>();
56 registry.insert<llzk::boolean::BoolDialect>();
57 registry.insert<llzk::array::ArrayDialect>();
58 registry.insert<llzk::component::StructDialect>();
59 registry.insert<llzk::constrain::ConstrainDialect>();
60 registry.insert<llzk::felt::FeltDialect>();
61 registry.insert<llzk::global::GlobalDialect>();
62 registry.insert<llzk::include::IncludeDialect>();
63 registry.insert<llzk::function::FunctionDialect>();
64 registry.insert<llzk::string::StringDialect>();
65 registry.insert<llzk::polymorphic::PolymorphicDialect>();
66 registry.insert<llzk::undef::UndefDialect>();
67 registry.insert<mlir::arith::ArithDialect>();
68 registry.insert<mlir::scf::SCFDialect>();
69 }
70
74 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphPrinterPassBase<DerivedT>)
75
76protected:
77private:
78};
79} // namespace impl
80#undef GEN_PASS_DEF_CALLGRAPHPRINTERPASS
81#endif // GEN_PASS_DEF_CALLGRAPHPRINTERPASS
82
83//===----------------------------------------------------------------------===//
84// CallGraphSCCsPrinterPass
85//===----------------------------------------------------------------------===//
86#ifdef GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
87#undef GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
88#endif // GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
89#ifdef GEN_PASS_DEF_CALLGRAPHSCCSPRINTERPASS
90namespace impl {
91
92template <typename DerivedT>
93class CallGraphSCCsPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
94public:
95 using Base = CallGraphSCCsPrinterPassBase;
96
97 CallGraphSCCsPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
98 CallGraphSCCsPrinterPassBase(const CallGraphSCCsPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
99
101 static constexpr ::llvm::StringLiteral getArgumentName() {
102 return ::llvm::StringLiteral("llzk-print-call-graph-sccs");
103 }
104 ::llvm::StringRef getArgument() const override { return "llzk-print-call-graph-sccs"; }
105
106 ::llvm::StringRef getDescription() const override { return "Print the SCCs from the LLZK module's call graph."; }
107
109 static constexpr ::llvm::StringLiteral getPassName() {
110 return ::llvm::StringLiteral("CallGraphSCCsPrinterPass");
111 }
112 ::llvm::StringRef getName() const override { return "CallGraphSCCsPrinterPass"; }
113
115 static bool classof(const ::mlir::Pass *pass) {
116 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
117 }
118
120 std::unique_ptr<::mlir::Pass> clonePass() const override {
121 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
122 }
123
125 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
126 registry.insert<llzk::LLZKDialect>();
127 registry.insert<llzk::boolean::BoolDialect>();
128 registry.insert<llzk::array::ArrayDialect>();
129 registry.insert<llzk::component::StructDialect>();
130 registry.insert<llzk::constrain::ConstrainDialect>();
131 registry.insert<llzk::felt::FeltDialect>();
132 registry.insert<llzk::global::GlobalDialect>();
133 registry.insert<llzk::include::IncludeDialect>();
134 registry.insert<llzk::function::FunctionDialect>();
135 registry.insert<llzk::string::StringDialect>();
136 registry.insert<llzk::polymorphic::PolymorphicDialect>();
137 registry.insert<llzk::undef::UndefDialect>();
138 registry.insert<mlir::arith::ArithDialect>();
139 registry.insert<mlir::scf::SCFDialect>();
140 }
141
145 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphSCCsPrinterPassBase<DerivedT>)
146
147protected:
148private:
149};
150} // namespace impl
151#undef GEN_PASS_DEF_CALLGRAPHSCCSPRINTERPASS
152#endif // GEN_PASS_DEF_CALLGRAPHSCCSPRINTERPASS
153
154//===----------------------------------------------------------------------===//
155// ConstraintDependencyGraphPrinterPass
156//===----------------------------------------------------------------------===//
157#ifdef GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
158#undef GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
159#endif // GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
160#ifdef GEN_PASS_DEF_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
161namespace impl {
162
163template <typename DerivedT>
164class ConstraintDependencyGraphPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
165public:
166 using Base = ConstraintDependencyGraphPrinterPassBase;
167
168 ConstraintDependencyGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
169 ConstraintDependencyGraphPrinterPassBase(const ConstraintDependencyGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
170
172 static constexpr ::llvm::StringLiteral getArgumentName() {
173 return ::llvm::StringLiteral("llzk-print-constraint-dependency-graphs");
174 }
175 ::llvm::StringRef getArgument() const override { return "llzk-print-constraint-dependency-graphs"; }
176
177 ::llvm::StringRef getDescription() const override { return "Print constraint dependency graph for all LLZK structs."; }
178
180 static constexpr ::llvm::StringLiteral getPassName() {
181 return ::llvm::StringLiteral("ConstraintDependencyGraphPrinterPass");
182 }
183 ::llvm::StringRef getName() const override { return "ConstraintDependencyGraphPrinterPass"; }
184
186 static bool classof(const ::mlir::Pass *pass) {
187 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
188 }
189
191 std::unique_ptr<::mlir::Pass> clonePass() const override {
192 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
193 }
194
196 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
197 registry.insert<llzk::LLZKDialect>();
198 registry.insert<llzk::boolean::BoolDialect>();
199 registry.insert<llzk::array::ArrayDialect>();
200 registry.insert<llzk::component::StructDialect>();
201 registry.insert<llzk::constrain::ConstrainDialect>();
202 registry.insert<llzk::felt::FeltDialect>();
203 registry.insert<llzk::global::GlobalDialect>();
204 registry.insert<llzk::include::IncludeDialect>();
205 registry.insert<llzk::function::FunctionDialect>();
206 registry.insert<llzk::string::StringDialect>();
207 registry.insert<llzk::polymorphic::PolymorphicDialect>();
208 registry.insert<llzk::undef::UndefDialect>();
209 registry.insert<mlir::arith::ArithDialect>();
210 registry.insert<mlir::scf::SCFDialect>();
211 }
212
216 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ConstraintDependencyGraphPrinterPassBase<DerivedT>)
217
218protected:
219private:
220};
221} // namespace impl
222#undef GEN_PASS_DEF_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
223#endif // GEN_PASS_DEF_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
224
225//===----------------------------------------------------------------------===//
226// IntervalAnalysisPrinterPass
227//===----------------------------------------------------------------------===//
228#ifdef GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
229struct IntervalAnalysisPrinterPassOptions {
230 std::string fieldName = "bn128";
231 bool printSolverConstraints = false;
232};
233#undef GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
234#endif // GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
235#ifdef GEN_PASS_DEF_INTERVALANALYSISPRINTERPASS
236namespace impl {
237
238template <typename DerivedT>
239class IntervalAnalysisPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
240public:
241 using Base = IntervalAnalysisPrinterPassBase;
242
243 IntervalAnalysisPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
244 IntervalAnalysisPrinterPassBase(const IntervalAnalysisPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
245
247 static constexpr ::llvm::StringLiteral getArgumentName() {
248 return ::llvm::StringLiteral("llzk-print-interval-analysis");
249 }
250 ::llvm::StringRef getArgument() const override { return "llzk-print-interval-analysis"; }
251
252 ::llvm::StringRef getDescription() const override { return "Print interval analysis results for all LLZK structs."; }
253
255 static constexpr ::llvm::StringLiteral getPassName() {
256 return ::llvm::StringLiteral("IntervalAnalysisPrinterPass");
257 }
258 ::llvm::StringRef getName() const override { return "IntervalAnalysisPrinterPass"; }
259
261 static bool classof(const ::mlir::Pass *pass) {
262 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
263 }
264
266 std::unique_ptr<::mlir::Pass> clonePass() const override {
267 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
268 }
269
271 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
272 registry.insert<llzk::LLZKDialect>();
273 registry.insert<llzk::boolean::BoolDialect>();
274 registry.insert<llzk::array::ArrayDialect>();
275 registry.insert<llzk::component::StructDialect>();
276 registry.insert<llzk::constrain::ConstrainDialect>();
277 registry.insert<llzk::felt::FeltDialect>();
278 registry.insert<llzk::global::GlobalDialect>();
279 registry.insert<llzk::include::IncludeDialect>();
280 registry.insert<llzk::function::FunctionDialect>();
281 registry.insert<llzk::string::StringDialect>();
282 registry.insert<llzk::polymorphic::PolymorphicDialect>();
283 registry.insert<llzk::undef::UndefDialect>();
284 registry.insert<mlir::arith::ArithDialect>();
285 registry.insert<mlir::scf::SCFDialect>();
286 }
287
291 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(IntervalAnalysisPrinterPassBase<DerivedT>)
292
293 IntervalAnalysisPrinterPassBase(const IntervalAnalysisPrinterPassOptions &options) : IntervalAnalysisPrinterPassBase() {
294 fieldName = options.fieldName;
295 printSolverConstraints = options.printSolverConstraints;
296 }
297protected:
298 ::mlir::Pass::Option<std::string> fieldName{*this, "field", ::llvm::cl::desc("The field to use for interval analysis. Supported fields: bn128/bn254, babybear, goldilocks, mersenne31"), ::llvm::cl::init("bn128")};
299 ::mlir::Pass::Option<bool> printSolverConstraints{*this, "print-solver-constraints", ::llvm::cl::desc("Whether to output SMT solver constraints along with intervals."), ::llvm::cl::init(false)};
300private:
301};
302} // namespace impl
303#undef GEN_PASS_DEF_INTERVALANALYSISPRINTERPASS
304#endif // GEN_PASS_DEF_INTERVALANALYSISPRINTERPASS
305#ifdef GEN_PASS_REGISTRATION
306
307//===----------------------------------------------------------------------===//
308// CallGraphPrinterPass Registration
309//===----------------------------------------------------------------------===//
310
311inline void registerCallGraphPrinterPass() {
312 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
313 return llzk::createCallGraphPrinterPass(llvm::errs());
314 });
315}
316
317// Old registration code, kept for temporary backwards compatibility.
319 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
320 return llzk::createCallGraphPrinterPass(llvm::errs());
321 });
322}
323
324//===----------------------------------------------------------------------===//
325// CallGraphSCCsPrinterPass Registration
326//===----------------------------------------------------------------------===//
327
329 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
330 return llzk::createCallGraphSCCsPrinterPass(llvm::errs());
331 });
332}
333
334// Old registration code, kept for temporary backwards compatibility.
336 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
337 return llzk::createCallGraphSCCsPrinterPass(llvm::errs());
338 });
339}
340
341//===----------------------------------------------------------------------===//
342// ConstraintDependencyGraphPrinterPass Registration
343//===----------------------------------------------------------------------===//
344
346 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
348 });
349}
350
351// Old registration code, kept for temporary backwards compatibility.
353 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
355 });
356}
357
358//===----------------------------------------------------------------------===//
359// IntervalAnalysisPrinterPass Registration
360//===----------------------------------------------------------------------===//
361
363 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
364 return llzk::createIntervalAnalysisPrinterPass(llvm::errs());
365 });
366}
367
368// Old registration code, kept for temporary backwards compatibility.
370 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
371 return llzk::createIntervalAnalysisPrinterPass(llvm::errs());
372 });
373}
374
375//===----------------------------------------------------------------------===//
376// Analysis Registration
377//===----------------------------------------------------------------------===//
378
379inline void registerAnalysisPasses() {
384}
385#undef GEN_PASS_REGISTRATION
386#endif // GEN_PASS_REGISTRATION
387// Deprecated. Please use the new per-pass macros.
388#ifdef GEN_PASS_CLASSES
389
390template <typename DerivedT>
391class CallGraphPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
392public:
393 using Base = CallGraphPrinterPassBase;
394
395 CallGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
396 CallGraphPrinterPassBase(const CallGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
397
399 static constexpr ::llvm::StringLiteral getArgumentName() {
400 return ::llvm::StringLiteral("llzk-print-call-graph");
401 }
402 ::llvm::StringRef getArgument() const override { return "llzk-print-call-graph"; }
403
404 ::llvm::StringRef getDescription() const override { return "Print the LLZK module's call graph."; }
405
407 static constexpr ::llvm::StringLiteral getPassName() {
408 return ::llvm::StringLiteral("CallGraphPrinterPass");
409 }
410 ::llvm::StringRef getName() const override { return "CallGraphPrinterPass"; }
411
413 static bool classof(const ::mlir::Pass *pass) {
414 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
415 }
416
418 std::unique_ptr<::mlir::Pass> clonePass() const override {
419 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
420 }
421
423 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
424 registry.insert<llzk::LLZKDialect>();
425 registry.insert<llzk::boolean::BoolDialect>();
426 registry.insert<llzk::array::ArrayDialect>();
427 registry.insert<llzk::component::StructDialect>();
428 registry.insert<llzk::constrain::ConstrainDialect>();
429 registry.insert<llzk::felt::FeltDialect>();
430 registry.insert<llzk::global::GlobalDialect>();
431 registry.insert<llzk::include::IncludeDialect>();
432 registry.insert<llzk::function::FunctionDialect>();
433 registry.insert<llzk::string::StringDialect>();
434 registry.insert<llzk::polymorphic::PolymorphicDialect>();
435 registry.insert<llzk::undef::UndefDialect>();
436 registry.insert<mlir::arith::ArithDialect>();
437 registry.insert<mlir::scf::SCFDialect>();
438 }
439
443 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphPrinterPassBase<DerivedT>)
444
445protected:
446};
447
448template <typename DerivedT>
449class CallGraphSCCsPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
450public:
451 using Base = CallGraphSCCsPrinterPassBase;
452
453 CallGraphSCCsPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
454 CallGraphSCCsPrinterPassBase(const CallGraphSCCsPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
455
457 static constexpr ::llvm::StringLiteral getArgumentName() {
458 return ::llvm::StringLiteral("llzk-print-call-graph-sccs");
459 }
460 ::llvm::StringRef getArgument() const override { return "llzk-print-call-graph-sccs"; }
461
462 ::llvm::StringRef getDescription() const override { return "Print the SCCs from the LLZK module's call graph."; }
463
465 static constexpr ::llvm::StringLiteral getPassName() {
466 return ::llvm::StringLiteral("CallGraphSCCsPrinterPass");
467 }
468 ::llvm::StringRef getName() const override { return "CallGraphSCCsPrinterPass"; }
469
471 static bool classof(const ::mlir::Pass *pass) {
472 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
473 }
474
476 std::unique_ptr<::mlir::Pass> clonePass() const override {
477 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
478 }
479
481 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
482 registry.insert<llzk::LLZKDialect>();
483 registry.insert<llzk::boolean::BoolDialect>();
484 registry.insert<llzk::array::ArrayDialect>();
485 registry.insert<llzk::component::StructDialect>();
486 registry.insert<llzk::constrain::ConstrainDialect>();
487 registry.insert<llzk::felt::FeltDialect>();
488 registry.insert<llzk::global::GlobalDialect>();
489 registry.insert<llzk::include::IncludeDialect>();
490 registry.insert<llzk::function::FunctionDialect>();
491 registry.insert<llzk::string::StringDialect>();
492 registry.insert<llzk::polymorphic::PolymorphicDialect>();
493 registry.insert<llzk::undef::UndefDialect>();
494 registry.insert<mlir::arith::ArithDialect>();
495 registry.insert<mlir::scf::SCFDialect>();
496 }
497
501 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphSCCsPrinterPassBase<DerivedT>)
502
503protected:
504};
505
506template <typename DerivedT>
507class ConstraintDependencyGraphPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
508public:
509 using Base = ConstraintDependencyGraphPrinterPassBase;
510
511 ConstraintDependencyGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
512 ConstraintDependencyGraphPrinterPassBase(const ConstraintDependencyGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
513
515 static constexpr ::llvm::StringLiteral getArgumentName() {
516 return ::llvm::StringLiteral("llzk-print-constraint-dependency-graphs");
517 }
518 ::llvm::StringRef getArgument() const override { return "llzk-print-constraint-dependency-graphs"; }
519
520 ::llvm::StringRef getDescription() const override { return "Print constraint dependency graph for all LLZK structs."; }
521
523 static constexpr ::llvm::StringLiteral getPassName() {
524 return ::llvm::StringLiteral("ConstraintDependencyGraphPrinterPass");
525 }
526 ::llvm::StringRef getName() const override { return "ConstraintDependencyGraphPrinterPass"; }
527
529 static bool classof(const ::mlir::Pass *pass) {
530 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
531 }
532
534 std::unique_ptr<::mlir::Pass> clonePass() const override {
535 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
536 }
537
539 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
540 registry.insert<llzk::LLZKDialect>();
541 registry.insert<llzk::boolean::BoolDialect>();
542 registry.insert<llzk::array::ArrayDialect>();
543 registry.insert<llzk::component::StructDialect>();
544 registry.insert<llzk::constrain::ConstrainDialect>();
545 registry.insert<llzk::felt::FeltDialect>();
546 registry.insert<llzk::global::GlobalDialect>();
547 registry.insert<llzk::include::IncludeDialect>();
548 registry.insert<llzk::function::FunctionDialect>();
549 registry.insert<llzk::string::StringDialect>();
550 registry.insert<llzk::polymorphic::PolymorphicDialect>();
551 registry.insert<llzk::undef::UndefDialect>();
552 registry.insert<mlir::arith::ArithDialect>();
553 registry.insert<mlir::scf::SCFDialect>();
554 }
555
559 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ConstraintDependencyGraphPrinterPassBase<DerivedT>)
560
561protected:
562};
563
564template <typename DerivedT>
565class IntervalAnalysisPrinterPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
566public:
567 using Base = IntervalAnalysisPrinterPassBase;
568
569 IntervalAnalysisPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
570 IntervalAnalysisPrinterPassBase(const IntervalAnalysisPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
571
573 static constexpr ::llvm::StringLiteral getArgumentName() {
574 return ::llvm::StringLiteral("llzk-print-interval-analysis");
575 }
576 ::llvm::StringRef getArgument() const override { return "llzk-print-interval-analysis"; }
577
578 ::llvm::StringRef getDescription() const override { return "Print interval analysis results for all LLZK structs."; }
579
581 static constexpr ::llvm::StringLiteral getPassName() {
582 return ::llvm::StringLiteral("IntervalAnalysisPrinterPass");
583 }
584 ::llvm::StringRef getName() const override { return "IntervalAnalysisPrinterPass"; }
585
587 static bool classof(const ::mlir::Pass *pass) {
588 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
589 }
590
592 std::unique_ptr<::mlir::Pass> clonePass() const override {
593 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
594 }
595
597 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
598 registry.insert<llzk::LLZKDialect>();
599 registry.insert<llzk::boolean::BoolDialect>();
600 registry.insert<llzk::array::ArrayDialect>();
601 registry.insert<llzk::component::StructDialect>();
602 registry.insert<llzk::constrain::ConstrainDialect>();
603 registry.insert<llzk::felt::FeltDialect>();
604 registry.insert<llzk::global::GlobalDialect>();
605 registry.insert<llzk::include::IncludeDialect>();
606 registry.insert<llzk::function::FunctionDialect>();
607 registry.insert<llzk::string::StringDialect>();
608 registry.insert<llzk::polymorphic::PolymorphicDialect>();
609 registry.insert<llzk::undef::UndefDialect>();
610 registry.insert<mlir::arith::ArithDialect>();
611 registry.insert<mlir::scf::SCFDialect>();
612 }
613
617 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(IntervalAnalysisPrinterPassBase<DerivedT>)
618
619protected:
620 ::mlir::Pass::Option<std::string> fieldName{*this, "field", ::llvm::cl::desc("The field to use for interval analysis. Supported fields: bn128/bn254, babybear, goldilocks, mersenne31"), ::llvm::cl::init("bn128")};
621 ::mlir::Pass::Option<bool> printSolverConstraints{*this, "print-solver-constraints", ::llvm::cl::desc("Whether to output SMT solver constraints along with intervals."), ::llvm::cl::init(false)};
622};
623#undef GEN_PASS_CLASSES
624#endif // GEN_PASS_CLASSES
void registerIntervalAnalysisPrinterPassPass()
void registerIntervalAnalysisPrinterPass()
std::unique_ptr< mlir::Pass > createConstraintDependencyGraphPrinterPass(llvm::raw_ostream &os=llvm::errs())
std::unique_ptr< mlir::Pass > createIntervalAnalysisPrinterPass(llvm::raw_ostream &os=llvm::errs())
void registerCallGraphPrinterPass()
void registerConstraintDependencyGraphPrinterPass()
std::unique_ptr< mlir::Pass > createCallGraphSCCsPrinterPass(llvm::raw_ostream &os=llvm::errs())
std::unique_ptr< mlir::Pass > createCallGraphPrinterPass(llvm::raw_ostream &os=llvm::errs())
void registerCallGraphPrinterPassPass()
void registerCallGraphSCCsPrinterPass()
void registerConstraintDependencyGraphPrinterPassPass()
void registerCallGraphSCCsPrinterPassPass()
void registerAnalysisPasses()