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#define GEN_PASS_DECL_PREDECESSORPRINTERPASS
10#define GEN_PASS_DECL_SYMBOLDEFTREEPRINTERPASS
11#define GEN_PASS_DECL_SYMBOLUSEGRAPHPRINTERPASS
18#ifdef GEN_PASS_DECL_CALLGRAPHPRINTERPASS
19#undef GEN_PASS_DECL_CALLGRAPHPRINTERPASS
21#ifdef GEN_PASS_DEF_CALLGRAPHPRINTERPASS
24template <
typename DerivedT>
25class CallGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
27 using Base = CallGraphPrinterPassBase;
29 CallGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
30 CallGraphPrinterPassBase(
const CallGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
31 CallGraphPrinterPassBase& operator=(
const CallGraphPrinterPassBase &) =
delete;
32 CallGraphPrinterPassBase(CallGraphPrinterPassBase &&) =
delete;
33 CallGraphPrinterPassBase& operator=(CallGraphPrinterPassBase &&) =
delete;
34 ~CallGraphPrinterPassBase() =
default;
37 static constexpr ::llvm::StringLiteral getArgumentName() {
38 return ::llvm::StringLiteral(
"llzk-print-call-graph");
40 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph"; }
42 ::llvm::StringRef getDescription()
const override {
return "Print the LLZK module's call graph."; }
45 static constexpr ::llvm::StringLiteral getPassName() {
46 return ::llvm::StringLiteral(
"CallGraphPrinterPass");
48 ::llvm::StringRef getName()
const override {
return "CallGraphPrinterPass"; }
51 static bool classof(const ::mlir::Pass *pass) {
52 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
56 std::unique_ptr<::mlir::Pass> clonePass()
const override {
57 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
61 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
62 registry.insert<llzk::LLZKDialect>();
63 registry.insert<llzk::boolean::BoolDialect>();
64 registry.insert<llzk::array::ArrayDialect>();
65 registry.insert<llzk::component::StructDialect>();
66 registry.insert<llzk::constrain::ConstrainDialect>();
67 registry.insert<llzk::felt::FeltDialect>();
68 registry.insert<llzk::global::GlobalDialect>();
69 registry.insert<llzk::include::IncludeDialect>();
70 registry.insert<llzk::function::FunctionDialect>();
71 registry.insert<llzk::string::StringDialect>();
72 registry.insert<llzk::polymorphic::PolymorphicDialect>();
73 registry.insert<mlir::arith::ArithDialect>();
74 registry.insert<mlir::scf::SCFDialect>();
80 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphPrinterPassBase<DerivedT>)
86#undef GEN_PASS_DEF_CALLGRAPHPRINTERPASS
92#ifdef GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
93#undef GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
95#ifdef GEN_PASS_DEF_CALLGRAPHSCCSPRINTERPASS
98template <
typename DerivedT>
99class CallGraphSCCsPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
101 using Base = CallGraphSCCsPrinterPassBase;
103 CallGraphSCCsPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
104 CallGraphSCCsPrinterPassBase(
const CallGraphSCCsPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
105 CallGraphSCCsPrinterPassBase& operator=(
const CallGraphSCCsPrinterPassBase &) =
delete;
106 CallGraphSCCsPrinterPassBase(CallGraphSCCsPrinterPassBase &&) =
delete;
107 CallGraphSCCsPrinterPassBase& operator=(CallGraphSCCsPrinterPassBase &&) =
delete;
108 ~CallGraphSCCsPrinterPassBase() =
default;
111 static constexpr ::llvm::StringLiteral getArgumentName() {
112 return ::llvm::StringLiteral(
"llzk-print-call-graph-sccs");
114 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph-sccs"; }
116 ::llvm::StringRef getDescription()
const override {
return "Print the SCCs from the LLZK module's call graph."; }
119 static constexpr ::llvm::StringLiteral getPassName() {
120 return ::llvm::StringLiteral(
"CallGraphSCCsPrinterPass");
122 ::llvm::StringRef getName()
const override {
return "CallGraphSCCsPrinterPass"; }
125 static bool classof(const ::mlir::Pass *pass) {
126 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
130 std::unique_ptr<::mlir::Pass> clonePass()
const override {
131 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
135 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
136 registry.insert<llzk::LLZKDialect>();
137 registry.insert<llzk::boolean::BoolDialect>();
138 registry.insert<llzk::array::ArrayDialect>();
139 registry.insert<llzk::component::StructDialect>();
140 registry.insert<llzk::constrain::ConstrainDialect>();
141 registry.insert<llzk::felt::FeltDialect>();
142 registry.insert<llzk::global::GlobalDialect>();
143 registry.insert<llzk::include::IncludeDialect>();
144 registry.insert<llzk::function::FunctionDialect>();
145 registry.insert<llzk::string::StringDialect>();
146 registry.insert<llzk::polymorphic::PolymorphicDialect>();
147 registry.insert<mlir::arith::ArithDialect>();
148 registry.insert<mlir::scf::SCFDialect>();
154 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphSCCsPrinterPassBase<DerivedT>)
160#undef GEN_PASS_DEF_CALLGRAPHSCCSPRINTERPASS
166#ifdef GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
167struct ConstraintDependencyGraphPrinterPassOptions {
168 bool runIntraprocedural =
false;
170#undef GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
172#ifdef GEN_PASS_DEF_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
175template <
typename DerivedT>
176class ConstraintDependencyGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
178 using Base = ConstraintDependencyGraphPrinterPassBase;
180 ConstraintDependencyGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
181 ConstraintDependencyGraphPrinterPassBase(
const ConstraintDependencyGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
182 ConstraintDependencyGraphPrinterPassBase& operator=(
const ConstraintDependencyGraphPrinterPassBase &) =
delete;
183 ConstraintDependencyGraphPrinterPassBase(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
184 ConstraintDependencyGraphPrinterPassBase& operator=(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
185 ~ConstraintDependencyGraphPrinterPassBase() =
default;
188 static constexpr ::llvm::StringLiteral getArgumentName() {
189 return ::llvm::StringLiteral(
"llzk-print-constraint-dependency-graphs");
191 ::llvm::StringRef getArgument()
const override {
return "llzk-print-constraint-dependency-graphs"; }
193 ::llvm::StringRef getDescription()
const override {
return "Print constraint dependency graph for all LLZK structs."; }
196 static constexpr ::llvm::StringLiteral getPassName() {
197 return ::llvm::StringLiteral(
"ConstraintDependencyGraphPrinterPass");
199 ::llvm::StringRef getName()
const override {
return "ConstraintDependencyGraphPrinterPass"; }
202 static bool classof(const ::mlir::Pass *pass) {
203 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
207 std::unique_ptr<::mlir::Pass> clonePass()
const override {
208 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
212 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
213 registry.insert<llzk::LLZKDialect>();
214 registry.insert<llzk::boolean::BoolDialect>();
215 registry.insert<llzk::array::ArrayDialect>();
216 registry.insert<llzk::component::StructDialect>();
217 registry.insert<llzk::constrain::ConstrainDialect>();
218 registry.insert<llzk::felt::FeltDialect>();
219 registry.insert<llzk::global::GlobalDialect>();
220 registry.insert<llzk::include::IncludeDialect>();
221 registry.insert<llzk::function::FunctionDialect>();
222 registry.insert<llzk::string::StringDialect>();
223 registry.insert<llzk::polymorphic::PolymorphicDialect>();
224 registry.insert<mlir::arith::ArithDialect>();
225 registry.insert<mlir::scf::SCFDialect>();
231 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ConstraintDependencyGraphPrinterPassBase<DerivedT>)
233 ConstraintDependencyGraphPrinterPassBase(ConstraintDependencyGraphPrinterPassOptions options) : ConstraintDependencyGraphPrinterPassBase() {
234 runIntraprocedural = std::move(options.runIntraprocedural);
237 ::mlir::Pass::Option<bool> runIntraprocedural{*
this,
"intraprocedural", ::llvm::cl::desc(
"Whether to run the analysis intra-procedurally only (default is false)."), ::llvm::cl::init(
false)};
241#undef GEN_PASS_DEF_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
247#ifdef GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
248struct IntervalAnalysisPrinterPassOptions {
249 std::string fieldName =
"";
250 bool propagateInputConstraints =
false;
251 bool printSolverConstraints =
false;
252 bool printComputeIntervals =
false;
254#undef GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
256#ifdef GEN_PASS_DEF_INTERVALANALYSISPRINTERPASS
259template <
typename DerivedT>
260class IntervalAnalysisPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
262 using Base = IntervalAnalysisPrinterPassBase;
264 IntervalAnalysisPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
265 IntervalAnalysisPrinterPassBase(
const IntervalAnalysisPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
266 IntervalAnalysisPrinterPassBase& operator=(
const IntervalAnalysisPrinterPassBase &) =
delete;
267 IntervalAnalysisPrinterPassBase(IntervalAnalysisPrinterPassBase &&) =
delete;
268 IntervalAnalysisPrinterPassBase& operator=(IntervalAnalysisPrinterPassBase &&) =
delete;
269 ~IntervalAnalysisPrinterPassBase() =
default;
272 static constexpr ::llvm::StringLiteral getArgumentName() {
273 return ::llvm::StringLiteral(
"llzk-print-interval-analysis");
275 ::llvm::StringRef getArgument()
const override {
return "llzk-print-interval-analysis"; }
277 ::llvm::StringRef getDescription()
const override {
return "Print interval analysis results for all LLZK structs."; }
280 static constexpr ::llvm::StringLiteral getPassName() {
281 return ::llvm::StringLiteral(
"IntervalAnalysisPrinterPass");
283 ::llvm::StringRef getName()
const override {
return "IntervalAnalysisPrinterPass"; }
286 static bool classof(const ::mlir::Pass *pass) {
287 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
291 std::unique_ptr<::mlir::Pass> clonePass()
const override {
292 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
296 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
297 registry.insert<llzk::LLZKDialect>();
298 registry.insert<llzk::boolean::BoolDialect>();
299 registry.insert<llzk::array::ArrayDialect>();
300 registry.insert<llzk::component::StructDialect>();
301 registry.insert<llzk::constrain::ConstrainDialect>();
302 registry.insert<llzk::felt::FeltDialect>();
303 registry.insert<llzk::global::GlobalDialect>();
304 registry.insert<llzk::include::IncludeDialect>();
305 registry.insert<llzk::function::FunctionDialect>();
306 registry.insert<llzk::string::StringDialect>();
307 registry.insert<llzk::polymorphic::PolymorphicDialect>();
308 registry.insert<mlir::arith::ArithDialect>();
309 registry.insert<mlir::scf::SCFDialect>();
315 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(IntervalAnalysisPrinterPassBase<DerivedT>)
317 IntervalAnalysisPrinterPassBase(IntervalAnalysisPrinterPassOptions options) : IntervalAnalysisPrinterPassBase() {
318 fieldName = std::move(options.fieldName);
319 propagateInputConstraints = std::move(options.propagateInputConstraints);
320 printSolverConstraints = std::move(options.printSolverConstraints);
321 printComputeIntervals = std::move(options.printComputeIntervals);
324 ::mlir::Pass::Option<std::string> fieldName{*
this,
"field", ::llvm::cl::desc(
"The field to use for interval analysis. If supplied, this always overrides the module's detected field. If omitted, the pass first tries to detect a single field from the enclosing module's felt usage and otherwise falls back to bn128. Supported fields: bn128/bn254, babybear, goldilocks, koalabear, mersenne31"), ::llvm::cl::init(
"")};
325 ::mlir::Pass::Option<bool> propagateInputConstraints{*
this,
"propagate-input-constraints", ::llvm::cl::desc(
"Whether to propagate constraints on inputs from @constrain to @compute functions. This allows for tighter intervals to possibly be found for computed values, assuming that the witness generator would include constraints as assertions during the computation."), ::llvm::cl::init(
false)};
326 ::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)};
327 ::mlir::Pass::Option<bool> printComputeIntervals{*
this,
"print-compute-intervals", ::llvm::cl::desc(
"Whether to print compute function intervals (default only prints constrain function intervals)."), ::llvm::cl::init(
false)};
331#undef GEN_PASS_DEF_INTERVALANALYSISPRINTERPASS
337#ifdef GEN_PASS_DECL_PREDECESSORPRINTERPASS
338struct PredecessorPrinterPassOptions {
340 bool preRunRequiredAnalyses =
false;
342#undef GEN_PASS_DECL_PREDECESSORPRINTERPASS
344#ifdef GEN_PASS_DEF_PREDECESSORPRINTERPASS
347template <
typename DerivedT>
348class PredecessorPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
350 using Base = PredecessorPrinterPassBase;
352 PredecessorPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
353 PredecessorPrinterPassBase(
const PredecessorPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
354 PredecessorPrinterPassBase& operator=(
const PredecessorPrinterPassBase &) =
delete;
355 PredecessorPrinterPassBase(PredecessorPrinterPassBase &&) =
delete;
356 PredecessorPrinterPassBase& operator=(PredecessorPrinterPassBase &&) =
delete;
357 ~PredecessorPrinterPassBase() =
default;
360 static constexpr ::llvm::StringLiteral getArgumentName() {
361 return ::llvm::StringLiteral(
"llzk-print-predecessors");
363 ::llvm::StringRef getArgument()
const override {
return "llzk-print-predecessors"; }
365 ::llvm::StringRef getDescription()
const override {
return "Print the predecessors of all operations."; }
368 static constexpr ::llvm::StringLiteral getPassName() {
369 return ::llvm::StringLiteral(
"PredecessorPrinterPass");
371 ::llvm::StringRef getName()
const override {
return "PredecessorPrinterPass"; }
374 static bool classof(const ::mlir::Pass *pass) {
375 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
379 std::unique_ptr<::mlir::Pass> clonePass()
const override {
380 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
384 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
385 registry.insert<llzk::LLZKDialect>();
386 registry.insert<llzk::boolean::BoolDialect>();
387 registry.insert<llzk::array::ArrayDialect>();
388 registry.insert<llzk::component::StructDialect>();
389 registry.insert<llzk::constrain::ConstrainDialect>();
390 registry.insert<llzk::felt::FeltDialect>();
391 registry.insert<llzk::global::GlobalDialect>();
392 registry.insert<llzk::include::IncludeDialect>();
393 registry.insert<llzk::function::FunctionDialect>();
394 registry.insert<llzk::string::StringDialect>();
395 registry.insert<llzk::polymorphic::PolymorphicDialect>();
396 registry.insert<mlir::arith::ArithDialect>();
397 registry.insert<mlir::scf::SCFDialect>();
403 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(PredecessorPrinterPassBase<DerivedT>)
405 PredecessorPrinterPassBase(PredecessorPrinterPassOptions options) : PredecessorPrinterPassBase() {
406 outputStream = std::move(options.outputStream);
407 preRunRequiredAnalyses = std::move(options.preRunRequiredAnalyses);
410 ::mlir::Pass::Option<::llzk::OutputStream> outputStream{*
this,
"stream", ::llvm::cl::desc(
"Specifies the stream to which the pass prints."), ::llvm::cl::init(
::llzk::OutputStream::Errs), ::llvm::cl::values(
412 "Print pass output to 'llvm::outs()'"),
414 "Print pass output to 'llvm::errs()'"),
416 "Print pass output to 'llvm::dbgs()'")
418 ::mlir::Pass::Option<bool> preRunRequiredAnalyses{*
this,
"prerun", ::llvm::cl::desc(
"Whether to pre-run the required dataflow analyses (e.g., liveness analysis)."), ::llvm::cl::init(
false)};
422#undef GEN_PASS_DEF_PREDECESSORPRINTERPASS
428#ifdef GEN_PASS_DECL_SYMBOLDEFTREEPRINTERPASS
429struct SymbolDefTreePrinterPassOptions {
431 bool saveDotGraph =
false;
433#undef GEN_PASS_DECL_SYMBOLDEFTREEPRINTERPASS
435#ifdef GEN_PASS_DEF_SYMBOLDEFTREEPRINTERPASS
438template <
typename DerivedT>
439class SymbolDefTreePrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
441 using Base = SymbolDefTreePrinterPassBase;
443 SymbolDefTreePrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
444 SymbolDefTreePrinterPassBase(
const SymbolDefTreePrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
445 SymbolDefTreePrinterPassBase& operator=(
const SymbolDefTreePrinterPassBase &) =
delete;
446 SymbolDefTreePrinterPassBase(SymbolDefTreePrinterPassBase &&) =
delete;
447 SymbolDefTreePrinterPassBase& operator=(SymbolDefTreePrinterPassBase &&) =
delete;
448 ~SymbolDefTreePrinterPassBase() =
default;
451 static constexpr ::llvm::StringLiteral getArgumentName() {
452 return ::llvm::StringLiteral(
"llzk-print-symbol-def-tree");
454 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-def-tree"; }
456 ::llvm::StringRef getDescription()
const override {
return "Print symbol definition tree."; }
459 static constexpr ::llvm::StringLiteral getPassName() {
460 return ::llvm::StringLiteral(
"SymbolDefTreePrinterPass");
462 ::llvm::StringRef getName()
const override {
return "SymbolDefTreePrinterPass"; }
465 static bool classof(const ::mlir::Pass *pass) {
466 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
470 std::unique_ptr<::mlir::Pass> clonePass()
const override {
471 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
475 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
476 registry.insert<llzk::LLZKDialect>();
477 registry.insert<llzk::boolean::BoolDialect>();
478 registry.insert<llzk::array::ArrayDialect>();
479 registry.insert<llzk::component::StructDialect>();
480 registry.insert<llzk::constrain::ConstrainDialect>();
481 registry.insert<llzk::felt::FeltDialect>();
482 registry.insert<llzk::global::GlobalDialect>();
483 registry.insert<llzk::include::IncludeDialect>();
484 registry.insert<llzk::function::FunctionDialect>();
485 registry.insert<llzk::string::StringDialect>();
486 registry.insert<llzk::polymorphic::PolymorphicDialect>();
487 registry.insert<mlir::arith::ArithDialect>();
488 registry.insert<mlir::scf::SCFDialect>();
494 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolDefTreePrinterPassBase<DerivedT>)
496 SymbolDefTreePrinterPassBase(SymbolDefTreePrinterPassOptions options) : SymbolDefTreePrinterPassBase() {
497 outputStream = std::move(options.outputStream);
498 saveDotGraph = std::move(options.saveDotGraph);
501 ::mlir::Pass::Option<::llzk::OutputStream> outputStream{*
this,
"stream", ::llvm::cl::desc(
"Specifies the stream to which the pass prints."), ::llvm::cl::init(
::llzk::OutputStream::Errs), ::llvm::cl::values(
503 "Print pass output to 'llvm::outs()'"),
505 "Print pass output to 'llvm::errs()'"),
507 "Print pass output to 'llvm::dbgs()'")
509 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
513#undef GEN_PASS_DEF_SYMBOLDEFTREEPRINTERPASS
519#ifdef GEN_PASS_DECL_SYMBOLUSEGRAPHPRINTERPASS
520struct SymbolUseGraphPrinterPassOptions {
522 bool saveDotGraph =
false;
524#undef GEN_PASS_DECL_SYMBOLUSEGRAPHPRINTERPASS
526#ifdef GEN_PASS_DEF_SYMBOLUSEGRAPHPRINTERPASS
529template <
typename DerivedT>
530class SymbolUseGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
532 using Base = SymbolUseGraphPrinterPassBase;
534 SymbolUseGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
535 SymbolUseGraphPrinterPassBase(
const SymbolUseGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
536 SymbolUseGraphPrinterPassBase& operator=(
const SymbolUseGraphPrinterPassBase &) =
delete;
537 SymbolUseGraphPrinterPassBase(SymbolUseGraphPrinterPassBase &&) =
delete;
538 SymbolUseGraphPrinterPassBase& operator=(SymbolUseGraphPrinterPassBase &&) =
delete;
539 ~SymbolUseGraphPrinterPassBase() =
default;
542 static constexpr ::llvm::StringLiteral getArgumentName() {
543 return ::llvm::StringLiteral(
"llzk-print-symbol-use-graph");
545 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-use-graph"; }
547 ::llvm::StringRef getDescription()
const override {
return "Print symbol use graph."; }
550 static constexpr ::llvm::StringLiteral getPassName() {
551 return ::llvm::StringLiteral(
"SymbolUseGraphPrinterPass");
553 ::llvm::StringRef getName()
const override {
return "SymbolUseGraphPrinterPass"; }
556 static bool classof(const ::mlir::Pass *pass) {
557 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
561 std::unique_ptr<::mlir::Pass> clonePass()
const override {
562 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
566 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
567 registry.insert<llzk::LLZKDialect>();
568 registry.insert<llzk::boolean::BoolDialect>();
569 registry.insert<llzk::array::ArrayDialect>();
570 registry.insert<llzk::component::StructDialect>();
571 registry.insert<llzk::constrain::ConstrainDialect>();
572 registry.insert<llzk::felt::FeltDialect>();
573 registry.insert<llzk::global::GlobalDialect>();
574 registry.insert<llzk::include::IncludeDialect>();
575 registry.insert<llzk::function::FunctionDialect>();
576 registry.insert<llzk::string::StringDialect>();
577 registry.insert<llzk::polymorphic::PolymorphicDialect>();
578 registry.insert<mlir::arith::ArithDialect>();
579 registry.insert<mlir::scf::SCFDialect>();
585 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolUseGraphPrinterPassBase<DerivedT>)
587 SymbolUseGraphPrinterPassBase(SymbolUseGraphPrinterPassOptions options) : SymbolUseGraphPrinterPassBase() {
588 outputStream = std::move(options.outputStream);
589 saveDotGraph = std::move(options.saveDotGraph);
592 ::mlir::Pass::Option<::llzk::OutputStream> outputStream{*
this,
"stream", ::llvm::cl::desc(
"Specifies the stream to which the pass prints."), ::llvm::cl::init(
::llzk::OutputStream::Errs), ::llvm::cl::values(
594 "Print pass output to 'llvm::outs()'"),
596 "Print pass output to 'llvm::errs()'"),
598 "Print pass output to 'llvm::dbgs()'")
600 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
604#undef GEN_PASS_DEF_SYMBOLUSEGRAPHPRINTERPASS
606#ifdef GEN_PASS_REGISTRATION
613 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
620 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
630 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
637 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
647 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
654 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
664 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
671 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
681 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
688 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
698 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
705 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
715 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
722 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
740#undef GEN_PASS_REGISTRATION
743#ifdef GEN_PASS_CLASSES
745template <
typename DerivedT>
746class CallGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
748 using Base = CallGraphPrinterPassBase;
750 CallGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
751 CallGraphPrinterPassBase(
const CallGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
752 CallGraphPrinterPassBase& operator=(
const CallGraphPrinterPassBase &) =
delete;
753 CallGraphPrinterPassBase(CallGraphPrinterPassBase &&) =
delete;
754 CallGraphPrinterPassBase& operator=(CallGraphPrinterPassBase &&) =
delete;
755 ~CallGraphPrinterPassBase() =
default;
758 static constexpr ::llvm::StringLiteral getArgumentName() {
759 return ::llvm::StringLiteral(
"llzk-print-call-graph");
761 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph"; }
763 ::llvm::StringRef getDescription()
const override {
return "Print the LLZK module's call graph."; }
766 static constexpr ::llvm::StringLiteral getPassName() {
767 return ::llvm::StringLiteral(
"CallGraphPrinterPass");
769 ::llvm::StringRef getName()
const override {
return "CallGraphPrinterPass"; }
772 static bool classof(const ::mlir::Pass *pass) {
773 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
777 std::unique_ptr<::mlir::Pass> clonePass()
const override {
778 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
782 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
783 registry.insert<llzk::LLZKDialect>();
784 registry.insert<llzk::boolean::BoolDialect>();
785 registry.insert<llzk::array::ArrayDialect>();
786 registry.insert<llzk::component::StructDialect>();
787 registry.insert<llzk::constrain::ConstrainDialect>();
788 registry.insert<llzk::felt::FeltDialect>();
789 registry.insert<llzk::global::GlobalDialect>();
790 registry.insert<llzk::include::IncludeDialect>();
791 registry.insert<llzk::function::FunctionDialect>();
792 registry.insert<llzk::string::StringDialect>();
793 registry.insert<llzk::polymorphic::PolymorphicDialect>();
794 registry.insert<mlir::arith::ArithDialect>();
795 registry.insert<mlir::scf::SCFDialect>();
801 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphPrinterPassBase<DerivedT>)
806template <
typename DerivedT>
807class CallGraphSCCsPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
809 using Base = CallGraphSCCsPrinterPassBase;
811 CallGraphSCCsPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
812 CallGraphSCCsPrinterPassBase(
const CallGraphSCCsPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
813 CallGraphSCCsPrinterPassBase& operator=(
const CallGraphSCCsPrinterPassBase &) =
delete;
814 CallGraphSCCsPrinterPassBase(CallGraphSCCsPrinterPassBase &&) =
delete;
815 CallGraphSCCsPrinterPassBase& operator=(CallGraphSCCsPrinterPassBase &&) =
delete;
816 ~CallGraphSCCsPrinterPassBase() =
default;
819 static constexpr ::llvm::StringLiteral getArgumentName() {
820 return ::llvm::StringLiteral(
"llzk-print-call-graph-sccs");
822 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph-sccs"; }
824 ::llvm::StringRef getDescription()
const override {
return "Print the SCCs from the LLZK module's call graph."; }
827 static constexpr ::llvm::StringLiteral getPassName() {
828 return ::llvm::StringLiteral(
"CallGraphSCCsPrinterPass");
830 ::llvm::StringRef getName()
const override {
return "CallGraphSCCsPrinterPass"; }
833 static bool classof(const ::mlir::Pass *pass) {
834 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
838 std::unique_ptr<::mlir::Pass> clonePass()
const override {
839 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
843 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
844 registry.insert<llzk::LLZKDialect>();
845 registry.insert<llzk::boolean::BoolDialect>();
846 registry.insert<llzk::array::ArrayDialect>();
847 registry.insert<llzk::component::StructDialect>();
848 registry.insert<llzk::constrain::ConstrainDialect>();
849 registry.insert<llzk::felt::FeltDialect>();
850 registry.insert<llzk::global::GlobalDialect>();
851 registry.insert<llzk::include::IncludeDialect>();
852 registry.insert<llzk::function::FunctionDialect>();
853 registry.insert<llzk::string::StringDialect>();
854 registry.insert<llzk::polymorphic::PolymorphicDialect>();
855 registry.insert<mlir::arith::ArithDialect>();
856 registry.insert<mlir::scf::SCFDialect>();
862 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphSCCsPrinterPassBase<DerivedT>)
867template <
typename DerivedT>
868class ConstraintDependencyGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
870 using Base = ConstraintDependencyGraphPrinterPassBase;
872 ConstraintDependencyGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
873 ConstraintDependencyGraphPrinterPassBase(
const ConstraintDependencyGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
874 ConstraintDependencyGraphPrinterPassBase& operator=(
const ConstraintDependencyGraphPrinterPassBase &) =
delete;
875 ConstraintDependencyGraphPrinterPassBase(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
876 ConstraintDependencyGraphPrinterPassBase& operator=(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
877 ~ConstraintDependencyGraphPrinterPassBase() =
default;
880 static constexpr ::llvm::StringLiteral getArgumentName() {
881 return ::llvm::StringLiteral(
"llzk-print-constraint-dependency-graphs");
883 ::llvm::StringRef getArgument()
const override {
return "llzk-print-constraint-dependency-graphs"; }
885 ::llvm::StringRef getDescription()
const override {
return "Print constraint dependency graph for all LLZK structs."; }
888 static constexpr ::llvm::StringLiteral getPassName() {
889 return ::llvm::StringLiteral(
"ConstraintDependencyGraphPrinterPass");
891 ::llvm::StringRef getName()
const override {
return "ConstraintDependencyGraphPrinterPass"; }
894 static bool classof(const ::mlir::Pass *pass) {
895 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
899 std::unique_ptr<::mlir::Pass> clonePass()
const override {
900 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
904 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
905 registry.insert<llzk::LLZKDialect>();
906 registry.insert<llzk::boolean::BoolDialect>();
907 registry.insert<llzk::array::ArrayDialect>();
908 registry.insert<llzk::component::StructDialect>();
909 registry.insert<llzk::constrain::ConstrainDialect>();
910 registry.insert<llzk::felt::FeltDialect>();
911 registry.insert<llzk::global::GlobalDialect>();
912 registry.insert<llzk::include::IncludeDialect>();
913 registry.insert<llzk::function::FunctionDialect>();
914 registry.insert<llzk::string::StringDialect>();
915 registry.insert<llzk::polymorphic::PolymorphicDialect>();
916 registry.insert<mlir::arith::ArithDialect>();
917 registry.insert<mlir::scf::SCFDialect>();
923 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ConstraintDependencyGraphPrinterPassBase<DerivedT>)
926 ::mlir::Pass::Option<bool> runIntraprocedural{*
this,
"intraprocedural", ::llvm::cl::desc(
"Whether to run the analysis intra-procedurally only (default is false)."), ::llvm::cl::init(
false)};
929template <
typename DerivedT>
930class IntervalAnalysisPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
932 using Base = IntervalAnalysisPrinterPassBase;
934 IntervalAnalysisPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
935 IntervalAnalysisPrinterPassBase(
const IntervalAnalysisPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
936 IntervalAnalysisPrinterPassBase& operator=(
const IntervalAnalysisPrinterPassBase &) =
delete;
937 IntervalAnalysisPrinterPassBase(IntervalAnalysisPrinterPassBase &&) =
delete;
938 IntervalAnalysisPrinterPassBase& operator=(IntervalAnalysisPrinterPassBase &&) =
delete;
939 ~IntervalAnalysisPrinterPassBase() =
default;
942 static constexpr ::llvm::StringLiteral getArgumentName() {
943 return ::llvm::StringLiteral(
"llzk-print-interval-analysis");
945 ::llvm::StringRef getArgument()
const override {
return "llzk-print-interval-analysis"; }
947 ::llvm::StringRef getDescription()
const override {
return "Print interval analysis results for all LLZK structs."; }
950 static constexpr ::llvm::StringLiteral getPassName() {
951 return ::llvm::StringLiteral(
"IntervalAnalysisPrinterPass");
953 ::llvm::StringRef getName()
const override {
return "IntervalAnalysisPrinterPass"; }
956 static bool classof(const ::mlir::Pass *pass) {
957 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
961 std::unique_ptr<::mlir::Pass> clonePass()
const override {
962 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
966 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
967 registry.insert<llzk::LLZKDialect>();
968 registry.insert<llzk::boolean::BoolDialect>();
969 registry.insert<llzk::array::ArrayDialect>();
970 registry.insert<llzk::component::StructDialect>();
971 registry.insert<llzk::constrain::ConstrainDialect>();
972 registry.insert<llzk::felt::FeltDialect>();
973 registry.insert<llzk::global::GlobalDialect>();
974 registry.insert<llzk::include::IncludeDialect>();
975 registry.insert<llzk::function::FunctionDialect>();
976 registry.insert<llzk::string::StringDialect>();
977 registry.insert<llzk::polymorphic::PolymorphicDialect>();
978 registry.insert<mlir::arith::ArithDialect>();
979 registry.insert<mlir::scf::SCFDialect>();
985 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(IntervalAnalysisPrinterPassBase<DerivedT>)
988 ::mlir::Pass::Option<std::string> fieldName{*
this,
"field", ::llvm::cl::desc(
"The field to use for interval analysis. If supplied, this always overrides the module's detected field. If omitted, the pass first tries to detect a single field from the enclosing module's felt usage and otherwise falls back to bn128. Supported fields: bn128/bn254, babybear, goldilocks, koalabear, mersenne31"), ::llvm::cl::init(
"")};
989 ::mlir::Pass::Option<bool> propagateInputConstraints{*
this,
"propagate-input-constraints", ::llvm::cl::desc(
"Whether to propagate constraints on inputs from @constrain to @compute functions. This allows for tighter intervals to possibly be found for computed values, assuming that the witness generator would include constraints as assertions during the computation."), ::llvm::cl::init(
false)};
990 ::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)};
991 ::mlir::Pass::Option<bool> printComputeIntervals{*
this,
"print-compute-intervals", ::llvm::cl::desc(
"Whether to print compute function intervals (default only prints constrain function intervals)."), ::llvm::cl::init(
false)};
994template <
typename DerivedT>
995class PredecessorPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
997 using Base = PredecessorPrinterPassBase;
999 PredecessorPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1000 PredecessorPrinterPassBase(
const PredecessorPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1001 PredecessorPrinterPassBase& operator=(
const PredecessorPrinterPassBase &) =
delete;
1002 PredecessorPrinterPassBase(PredecessorPrinterPassBase &&) =
delete;
1003 PredecessorPrinterPassBase& operator=(PredecessorPrinterPassBase &&) =
delete;
1004 ~PredecessorPrinterPassBase() =
default;
1007 static constexpr ::llvm::StringLiteral getArgumentName() {
1008 return ::llvm::StringLiteral(
"llzk-print-predecessors");
1010 ::llvm::StringRef getArgument()
const override {
return "llzk-print-predecessors"; }
1012 ::llvm::StringRef getDescription()
const override {
return "Print the predecessors of all operations."; }
1015 static constexpr ::llvm::StringLiteral getPassName() {
1016 return ::llvm::StringLiteral(
"PredecessorPrinterPass");
1018 ::llvm::StringRef getName()
const override {
return "PredecessorPrinterPass"; }
1021 static bool classof(const ::mlir::Pass *pass) {
1022 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1026 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1027 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1031 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1032 registry.insert<llzk::LLZKDialect>();
1033 registry.insert<llzk::boolean::BoolDialect>();
1034 registry.insert<llzk::array::ArrayDialect>();
1035 registry.insert<llzk::component::StructDialect>();
1036 registry.insert<llzk::constrain::ConstrainDialect>();
1037 registry.insert<llzk::felt::FeltDialect>();
1038 registry.insert<llzk::global::GlobalDialect>();
1039 registry.insert<llzk::include::IncludeDialect>();
1040 registry.insert<llzk::function::FunctionDialect>();
1041 registry.insert<llzk::string::StringDialect>();
1042 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1043 registry.insert<mlir::arith::ArithDialect>();
1044 registry.insert<mlir::scf::SCFDialect>();
1050 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(PredecessorPrinterPassBase<DerivedT>)
1053 ::mlir::Pass::Option<::llzk::OutputStream> outputStream{*
this,
"stream", ::llvm::cl::desc(
"Specifies the stream to which the pass prints."), ::llvm::cl::init(
::llzk::OutputStream::Errs), ::llvm::cl::values(
1055 "Print pass output to 'llvm::outs()'"),
1057 "Print pass output to 'llvm::errs()'"),
1059 "Print pass output to 'llvm::dbgs()'")
1061 ::mlir::Pass::Option<bool> preRunRequiredAnalyses{*
this,
"prerun", ::llvm::cl::desc(
"Whether to pre-run the required dataflow analyses (e.g., liveness analysis)."), ::llvm::cl::init(
false)};
1064template <
typename DerivedT>
1065class SymbolDefTreePrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1067 using Base = SymbolDefTreePrinterPassBase;
1069 SymbolDefTreePrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1070 SymbolDefTreePrinterPassBase(
const SymbolDefTreePrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1071 SymbolDefTreePrinterPassBase& operator=(
const SymbolDefTreePrinterPassBase &) =
delete;
1072 SymbolDefTreePrinterPassBase(SymbolDefTreePrinterPassBase &&) =
delete;
1073 SymbolDefTreePrinterPassBase& operator=(SymbolDefTreePrinterPassBase &&) =
delete;
1074 ~SymbolDefTreePrinterPassBase() =
default;
1077 static constexpr ::llvm::StringLiteral getArgumentName() {
1078 return ::llvm::StringLiteral(
"llzk-print-symbol-def-tree");
1080 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-def-tree"; }
1082 ::llvm::StringRef getDescription()
const override {
return "Print symbol definition tree."; }
1085 static constexpr ::llvm::StringLiteral getPassName() {
1086 return ::llvm::StringLiteral(
"SymbolDefTreePrinterPass");
1088 ::llvm::StringRef getName()
const override {
return "SymbolDefTreePrinterPass"; }
1091 static bool classof(const ::mlir::Pass *pass) {
1092 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1096 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1097 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1101 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1102 registry.insert<llzk::LLZKDialect>();
1103 registry.insert<llzk::boolean::BoolDialect>();
1104 registry.insert<llzk::array::ArrayDialect>();
1105 registry.insert<llzk::component::StructDialect>();
1106 registry.insert<llzk::constrain::ConstrainDialect>();
1107 registry.insert<llzk::felt::FeltDialect>();
1108 registry.insert<llzk::global::GlobalDialect>();
1109 registry.insert<llzk::include::IncludeDialect>();
1110 registry.insert<llzk::function::FunctionDialect>();
1111 registry.insert<llzk::string::StringDialect>();
1112 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1113 registry.insert<mlir::arith::ArithDialect>();
1114 registry.insert<mlir::scf::SCFDialect>();
1120 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolDefTreePrinterPassBase<DerivedT>)
1123 ::mlir::Pass::Option<::llzk::OutputStream> outputStream{*
this,
"stream", ::llvm::cl::desc(
"Specifies the stream to which the pass prints."), ::llvm::cl::init(
::llzk::OutputStream::Errs), ::llvm::cl::values(
1125 "Print pass output to 'llvm::outs()'"),
1127 "Print pass output to 'llvm::errs()'"),
1129 "Print pass output to 'llvm::dbgs()'")
1131 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
1134template <
typename DerivedT>
1135class SymbolUseGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1137 using Base = SymbolUseGraphPrinterPassBase;
1139 SymbolUseGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1140 SymbolUseGraphPrinterPassBase(
const SymbolUseGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1141 SymbolUseGraphPrinterPassBase& operator=(
const SymbolUseGraphPrinterPassBase &) =
delete;
1142 SymbolUseGraphPrinterPassBase(SymbolUseGraphPrinterPassBase &&) =
delete;
1143 SymbolUseGraphPrinterPassBase& operator=(SymbolUseGraphPrinterPassBase &&) =
delete;
1144 ~SymbolUseGraphPrinterPassBase() =
default;
1147 static constexpr ::llvm::StringLiteral getArgumentName() {
1148 return ::llvm::StringLiteral(
"llzk-print-symbol-use-graph");
1150 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-use-graph"; }
1152 ::llvm::StringRef getDescription()
const override {
return "Print symbol use graph."; }
1155 static constexpr ::llvm::StringLiteral getPassName() {
1156 return ::llvm::StringLiteral(
"SymbolUseGraphPrinterPass");
1158 ::llvm::StringRef getName()
const override {
return "SymbolUseGraphPrinterPass"; }
1161 static bool classof(const ::mlir::Pass *pass) {
1162 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1166 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1167 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1171 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1172 registry.insert<llzk::LLZKDialect>();
1173 registry.insert<llzk::boolean::BoolDialect>();
1174 registry.insert<llzk::array::ArrayDialect>();
1175 registry.insert<llzk::component::StructDialect>();
1176 registry.insert<llzk::constrain::ConstrainDialect>();
1177 registry.insert<llzk::felt::FeltDialect>();
1178 registry.insert<llzk::global::GlobalDialect>();
1179 registry.insert<llzk::include::IncludeDialect>();
1180 registry.insert<llzk::function::FunctionDialect>();
1181 registry.insert<llzk::string::StringDialect>();
1182 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1183 registry.insert<mlir::arith::ArithDialect>();
1184 registry.insert<mlir::scf::SCFDialect>();
1190 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolUseGraphPrinterPassBase<DerivedT>)
1193 ::mlir::Pass::Option<::llzk::OutputStream> outputStream{*
this,
"stream", ::llvm::cl::desc(
"Specifies the stream to which the pass prints."), ::llvm::cl::init(
::llzk::OutputStream::Errs), ::llvm::cl::values(
1195 "Print pass output to 'llvm::outs()'"),
1197 "Print pass output to 'llvm::errs()'"),
1199 "Print pass output to 'llvm::dbgs()'")
1201 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
1203#undef GEN_PASS_CLASSES
void registerIntervalAnalysisPrinterPassPass()
void registerSymbolDefTreePrinterPassPass()
std::unique_ptr< mlir::Pass > createPredecessorPrinterPass()
void registerPredecessorPrinterPassPass()
void registerIntervalAnalysisPrinterPass()
std::unique_ptr< mlir::Pass > createSymbolUseGraphPrinterPass()
void registerSymbolUseGraphPrinterPassPass()
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()
void registerSymbolUseGraphPrinterPass()
std::unique_ptr< mlir::Pass > createSymbolDefTreePrinterPass()
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()
::llvm::StringRef stringifyOutputStream(OutputStream val)
void registerPredecessorPrinterPass()
void registerCallGraphSCCsPrinterPass()
void registerConstraintDependencyGraphPrinterPassPass()
void registerCallGraphSCCsPrinterPassPass()
void registerAnalysisPasses()
void registerSymbolDefTreePrinterPass()