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
19struct CallGraphPrinterPassOptions {
24#undef GEN_PASS_DECL_CALLGRAPHPRINTERPASS
26#ifdef GEN_PASS_DEF_CALLGRAPHPRINTERPASS
37template <
typename DerivedT>
38class CallGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
40 using Base = CallGraphPrinterPassBase;
42 CallGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
43 CallGraphPrinterPassBase(
const CallGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
44 CallGraphPrinterPassBase& operator=(
const CallGraphPrinterPassBase &) =
delete;
45 CallGraphPrinterPassBase(CallGraphPrinterPassBase &&) =
delete;
46 CallGraphPrinterPassBase& operator=(CallGraphPrinterPassBase &&) =
delete;
47 ~CallGraphPrinterPassBase() =
default;
50 static constexpr ::llvm::StringLiteral getArgumentName() {
51 return ::llvm::StringLiteral(
"llzk-print-call-graph");
53 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph"; }
55 ::llvm::StringRef getDescription()
const override {
return "Print the LLZK module's call graph."; }
58 static constexpr ::llvm::StringLiteral getPassName() {
59 return ::llvm::StringLiteral(
"CallGraphPrinterPass");
61 ::llvm::StringRef getName()
const override {
return "CallGraphPrinterPass"; }
64 static bool classof(const ::mlir::Pass *pass) {
65 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
69 std::unique_ptr<::mlir::Pass> clonePass()
const override {
70 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
74 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
75 registry.insert<llzk::LLZKDialect>();
76 registry.insert<llzk::boolean::BoolDialect>();
77 registry.insert<llzk::array::ArrayDialect>();
78 registry.insert<llzk::component::StructDialect>();
79 registry.insert<llzk::constrain::ConstrainDialect>();
80 registry.insert<llzk::felt::FeltDialect>();
81 registry.insert<llzk::global::GlobalDialect>();
82 registry.insert<llzk::include::IncludeDialect>();
83 registry.insert<llzk::function::FunctionDialect>();
84 registry.insert<llzk::string::StringDialect>();
85 registry.insert<llzk::polymorphic::PolymorphicDialect>();
86 registry.insert<mlir::arith::ArithDialect>();
87 registry.insert<mlir::scf::SCFDialect>();
93 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphPrinterPassBase<DerivedT>)
95 CallGraphPrinterPassBase(CallGraphPrinterPassOptions options) : CallGraphPrinterPassBase() {
96 outputStream = std::move(options.outputStream);
99 ::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(
101 "Print pass output to 'llvm::outs()'"),
103 "Print pass output to 'llvm::errs()'"),
105 "Print pass output to 'llvm::dbgs()'")
110 return std::make_unique<DerivedT>();
114 return std::make_unique<DerivedT>(std::move(options));
120 return impl::createCallGraphPrinterPass();
124 return impl::createCallGraphPrinterPass(std::move(options));
126#undef GEN_PASS_DEF_CALLGRAPHPRINTERPASS
132#ifdef GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
133struct CallGraphSCCsPrinterPassOptions {
138#undef GEN_PASS_DECL_CALLGRAPHSCCSPRINTERPASS
140#ifdef GEN_PASS_DEF_CALLGRAPHSCCSPRINTERPASS
151template <
typename DerivedT>
152class CallGraphSCCsPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
154 using Base = CallGraphSCCsPrinterPassBase;
156 CallGraphSCCsPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
157 CallGraphSCCsPrinterPassBase(
const CallGraphSCCsPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
158 CallGraphSCCsPrinterPassBase& operator=(
const CallGraphSCCsPrinterPassBase &) =
delete;
159 CallGraphSCCsPrinterPassBase(CallGraphSCCsPrinterPassBase &&) =
delete;
160 CallGraphSCCsPrinterPassBase& operator=(CallGraphSCCsPrinterPassBase &&) =
delete;
161 ~CallGraphSCCsPrinterPassBase() =
default;
164 static constexpr ::llvm::StringLiteral getArgumentName() {
165 return ::llvm::StringLiteral(
"llzk-print-call-graph-sccs");
167 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph-sccs"; }
169 ::llvm::StringRef getDescription()
const override {
return "Print the SCCs from the LLZK module's call graph."; }
172 static constexpr ::llvm::StringLiteral getPassName() {
173 return ::llvm::StringLiteral(
"CallGraphSCCsPrinterPass");
175 ::llvm::StringRef getName()
const override {
return "CallGraphSCCsPrinterPass"; }
178 static bool classof(const ::mlir::Pass *pass) {
179 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
183 std::unique_ptr<::mlir::Pass> clonePass()
const override {
184 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
188 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
189 registry.insert<llzk::LLZKDialect>();
190 registry.insert<llzk::boolean::BoolDialect>();
191 registry.insert<llzk::array::ArrayDialect>();
192 registry.insert<llzk::component::StructDialect>();
193 registry.insert<llzk::constrain::ConstrainDialect>();
194 registry.insert<llzk::felt::FeltDialect>();
195 registry.insert<llzk::global::GlobalDialect>();
196 registry.insert<llzk::include::IncludeDialect>();
197 registry.insert<llzk::function::FunctionDialect>();
198 registry.insert<llzk::string::StringDialect>();
199 registry.insert<llzk::polymorphic::PolymorphicDialect>();
200 registry.insert<mlir::arith::ArithDialect>();
201 registry.insert<mlir::scf::SCFDialect>();
207 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphSCCsPrinterPassBase<DerivedT>)
209 CallGraphSCCsPrinterPassBase(CallGraphSCCsPrinterPassOptions options) : CallGraphSCCsPrinterPassBase() {
210 outputStream = std::move(options.outputStream);
213 ::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(
215 "Print pass output to 'llvm::outs()'"),
217 "Print pass output to 'llvm::errs()'"),
219 "Print pass output to 'llvm::dbgs()'")
224 return std::make_unique<DerivedT>();
228 return std::make_unique<DerivedT>(std::move(options));
234 return impl::createCallGraphSCCsPrinterPass();
238 return impl::createCallGraphSCCsPrinterPass(std::move(options));
240#undef GEN_PASS_DEF_CALLGRAPHSCCSPRINTERPASS
246#ifdef GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
247struct ConstraintDependencyGraphPrinterPassOptions {
249 bool runIntraprocedural =
false;
253#undef GEN_PASS_DECL_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
255#ifdef GEN_PASS_DEF_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
266template <
typename DerivedT>
267class ConstraintDependencyGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
269 using Base = ConstraintDependencyGraphPrinterPassBase;
271 ConstraintDependencyGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
272 ConstraintDependencyGraphPrinterPassBase(
const ConstraintDependencyGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
273 ConstraintDependencyGraphPrinterPassBase& operator=(
const ConstraintDependencyGraphPrinterPassBase &) =
delete;
274 ConstraintDependencyGraphPrinterPassBase(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
275 ConstraintDependencyGraphPrinterPassBase& operator=(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
276 ~ConstraintDependencyGraphPrinterPassBase() =
default;
279 static constexpr ::llvm::StringLiteral getArgumentName() {
280 return ::llvm::StringLiteral(
"llzk-print-constraint-dependency-graphs");
282 ::llvm::StringRef getArgument()
const override {
return "llzk-print-constraint-dependency-graphs"; }
284 ::llvm::StringRef getDescription()
const override {
return "Print constraint dependency graph for all LLZK structs."; }
287 static constexpr ::llvm::StringLiteral getPassName() {
288 return ::llvm::StringLiteral(
"ConstraintDependencyGraphPrinterPass");
290 ::llvm::StringRef getName()
const override {
return "ConstraintDependencyGraphPrinterPass"; }
293 static bool classof(const ::mlir::Pass *pass) {
294 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
298 std::unique_ptr<::mlir::Pass> clonePass()
const override {
299 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
303 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
304 registry.insert<llzk::LLZKDialect>();
305 registry.insert<llzk::boolean::BoolDialect>();
306 registry.insert<llzk::array::ArrayDialect>();
307 registry.insert<llzk::component::StructDialect>();
308 registry.insert<llzk::constrain::ConstrainDialect>();
309 registry.insert<llzk::felt::FeltDialect>();
310 registry.insert<llzk::global::GlobalDialect>();
311 registry.insert<llzk::include::IncludeDialect>();
312 registry.insert<llzk::function::FunctionDialect>();
313 registry.insert<llzk::string::StringDialect>();
314 registry.insert<llzk::polymorphic::PolymorphicDialect>();
315 registry.insert<mlir::arith::ArithDialect>();
316 registry.insert<mlir::scf::SCFDialect>();
322 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ConstraintDependencyGraphPrinterPassBase<DerivedT>)
324 ConstraintDependencyGraphPrinterPassBase(ConstraintDependencyGraphPrinterPassOptions options) : ConstraintDependencyGraphPrinterPassBase() {
325 outputStream = std::move(options.outputStream);
326 runIntraprocedural = std::move(options.runIntraprocedural);
329 ::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(
331 "Print pass output to 'llvm::outs()'"),
333 "Print pass output to 'llvm::errs()'"),
335 "Print pass output to 'llvm::dbgs()'")
337 ::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)};
341 return std::make_unique<DerivedT>();
345 return std::make_unique<DerivedT>(std::move(options));
351 return impl::createConstraintDependencyGraphPrinterPass();
355 return impl::createConstraintDependencyGraphPrinterPass(std::move(options));
357#undef GEN_PASS_DEF_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
363#ifdef GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
364struct IntervalAnalysisPrinterPassOptions {
366 std::string fieldName =
"";
367 bool propagateInputConstraints =
false;
368 bool printSolverConstraints =
false;
369 bool printComputeIntervals =
false;
370 bool printUnreducedIntervals =
false;
371 bool printSSAIntervals =
false;
375#undef GEN_PASS_DECL_INTERVALANALYSISPRINTERPASS
377#ifdef GEN_PASS_DEF_INTERVALANALYSISPRINTERPASS
388template <
typename DerivedT>
389class IntervalAnalysisPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
391 using Base = IntervalAnalysisPrinterPassBase;
393 IntervalAnalysisPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
394 IntervalAnalysisPrinterPassBase(
const IntervalAnalysisPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
395 IntervalAnalysisPrinterPassBase& operator=(
const IntervalAnalysisPrinterPassBase &) =
delete;
396 IntervalAnalysisPrinterPassBase(IntervalAnalysisPrinterPassBase &&) =
delete;
397 IntervalAnalysisPrinterPassBase& operator=(IntervalAnalysisPrinterPassBase &&) =
delete;
398 ~IntervalAnalysisPrinterPassBase() =
default;
401 static constexpr ::llvm::StringLiteral getArgumentName() {
402 return ::llvm::StringLiteral(
"llzk-print-interval-analysis");
404 ::llvm::StringRef getArgument()
const override {
return "llzk-print-interval-analysis"; }
406 ::llvm::StringRef getDescription()
const override {
return "Print interval analysis results for all LLZK structs."; }
409 static constexpr ::llvm::StringLiteral getPassName() {
410 return ::llvm::StringLiteral(
"IntervalAnalysisPrinterPass");
412 ::llvm::StringRef getName()
const override {
return "IntervalAnalysisPrinterPass"; }
415 static bool classof(const ::mlir::Pass *pass) {
416 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
420 std::unique_ptr<::mlir::Pass> clonePass()
const override {
421 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
425 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
426 registry.insert<llzk::LLZKDialect>();
427 registry.insert<llzk::boolean::BoolDialect>();
428 registry.insert<llzk::array::ArrayDialect>();
429 registry.insert<llzk::component::StructDialect>();
430 registry.insert<llzk::constrain::ConstrainDialect>();
431 registry.insert<llzk::felt::FeltDialect>();
432 registry.insert<llzk::global::GlobalDialect>();
433 registry.insert<llzk::include::IncludeDialect>();
434 registry.insert<llzk::function::FunctionDialect>();
435 registry.insert<llzk::string::StringDialect>();
436 registry.insert<llzk::polymorphic::PolymorphicDialect>();
437 registry.insert<mlir::arith::ArithDialect>();
438 registry.insert<mlir::scf::SCFDialect>();
444 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(IntervalAnalysisPrinterPassBase<DerivedT>)
446 IntervalAnalysisPrinterPassBase(IntervalAnalysisPrinterPassOptions options) : IntervalAnalysisPrinterPassBase() {
447 outputStream = std::move(options.outputStream);
448 fieldName = std::move(options.fieldName);
449 propagateInputConstraints = std::move(options.propagateInputConstraints);
450 printSolverConstraints = std::move(options.printSolverConstraints);
451 printComputeIntervals = std::move(options.printComputeIntervals);
452 printUnreducedIntervals = std::move(options.printUnreducedIntervals);
453 printSSAIntervals = std::move(options.printSSAIntervals);
456 ::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(
458 "Print pass output to 'llvm::outs()'"),
460 "Print pass output to 'llvm::errs()'"),
462 "Print pass output to 'llvm::dbgs()'")
464 ::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, grumpkin, koalabear, mersenne31"), ::llvm::cl::init(
"")};
465 ::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)};
466 ::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)};
467 ::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)};
468 ::mlir::Pass::Option<bool> printUnreducedIntervals{*
this,
"print-unreduced-intervals", ::llvm::cl::desc(
"Whether to print tracked unreduced intervals alongside reduced interval summaries."), ::llvm::cl::init(
false)};
469 ::mlir::Pass::Option<bool> printSSAIntervals{*
this,
"print-ssa-intervals", ::llvm::cl::desc(
"Whether to print per-SSA intervals for function arguments and scalar op results."), ::llvm::cl::init(
false)};
473 return std::make_unique<DerivedT>();
477 return std::make_unique<DerivedT>(std::move(options));
483 return impl::createIntervalAnalysisPrinterPass();
487 return impl::createIntervalAnalysisPrinterPass(std::move(options));
489#undef GEN_PASS_DEF_INTERVALANALYSISPRINTERPASS
495#ifdef GEN_PASS_DECL_PREDECESSORPRINTERPASS
496struct PredecessorPrinterPassOptions {
498 bool preRunRequiredAnalyses =
false;
502#undef GEN_PASS_DECL_PREDECESSORPRINTERPASS
504#ifdef GEN_PASS_DEF_PREDECESSORPRINTERPASS
515template <
typename DerivedT>
516class PredecessorPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
518 using Base = PredecessorPrinterPassBase;
520 PredecessorPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
521 PredecessorPrinterPassBase(
const PredecessorPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
522 PredecessorPrinterPassBase& operator=(
const PredecessorPrinterPassBase &) =
delete;
523 PredecessorPrinterPassBase(PredecessorPrinterPassBase &&) =
delete;
524 PredecessorPrinterPassBase& operator=(PredecessorPrinterPassBase &&) =
delete;
525 ~PredecessorPrinterPassBase() =
default;
528 static constexpr ::llvm::StringLiteral getArgumentName() {
529 return ::llvm::StringLiteral(
"llzk-print-predecessors");
531 ::llvm::StringRef getArgument()
const override {
return "llzk-print-predecessors"; }
533 ::llvm::StringRef getDescription()
const override {
return "Print the predecessors of all operations."; }
536 static constexpr ::llvm::StringLiteral getPassName() {
537 return ::llvm::StringLiteral(
"PredecessorPrinterPass");
539 ::llvm::StringRef getName()
const override {
return "PredecessorPrinterPass"; }
542 static bool classof(const ::mlir::Pass *pass) {
543 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
547 std::unique_ptr<::mlir::Pass> clonePass()
const override {
548 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
552 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
553 registry.insert<llzk::LLZKDialect>();
554 registry.insert<llzk::boolean::BoolDialect>();
555 registry.insert<llzk::array::ArrayDialect>();
556 registry.insert<llzk::component::StructDialect>();
557 registry.insert<llzk::constrain::ConstrainDialect>();
558 registry.insert<llzk::felt::FeltDialect>();
559 registry.insert<llzk::global::GlobalDialect>();
560 registry.insert<llzk::include::IncludeDialect>();
561 registry.insert<llzk::function::FunctionDialect>();
562 registry.insert<llzk::string::StringDialect>();
563 registry.insert<llzk::polymorphic::PolymorphicDialect>();
564 registry.insert<mlir::arith::ArithDialect>();
565 registry.insert<mlir::scf::SCFDialect>();
571 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(PredecessorPrinterPassBase<DerivedT>)
573 PredecessorPrinterPassBase(PredecessorPrinterPassOptions options) : PredecessorPrinterPassBase() {
574 outputStream = std::move(options.outputStream);
575 preRunRequiredAnalyses = std::move(options.preRunRequiredAnalyses);
578 ::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(
580 "Print pass output to 'llvm::outs()'"),
582 "Print pass output to 'llvm::errs()'"),
584 "Print pass output to 'llvm::dbgs()'")
586 ::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)};
590 return std::make_unique<DerivedT>();
594 return std::make_unique<DerivedT>(std::move(options));
600 return impl::createPredecessorPrinterPass();
604 return impl::createPredecessorPrinterPass(std::move(options));
606#undef GEN_PASS_DEF_PREDECESSORPRINTERPASS
612#ifdef GEN_PASS_DECL_SYMBOLDEFTREEPRINTERPASS
613struct SymbolDefTreePrinterPassOptions {
615 bool saveDotGraph =
false;
619#undef GEN_PASS_DECL_SYMBOLDEFTREEPRINTERPASS
621#ifdef GEN_PASS_DEF_SYMBOLDEFTREEPRINTERPASS
632template <
typename DerivedT>
633class SymbolDefTreePrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
635 using Base = SymbolDefTreePrinterPassBase;
637 SymbolDefTreePrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
638 SymbolDefTreePrinterPassBase(
const SymbolDefTreePrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
639 SymbolDefTreePrinterPassBase& operator=(
const SymbolDefTreePrinterPassBase &) =
delete;
640 SymbolDefTreePrinterPassBase(SymbolDefTreePrinterPassBase &&) =
delete;
641 SymbolDefTreePrinterPassBase& operator=(SymbolDefTreePrinterPassBase &&) =
delete;
642 ~SymbolDefTreePrinterPassBase() =
default;
645 static constexpr ::llvm::StringLiteral getArgumentName() {
646 return ::llvm::StringLiteral(
"llzk-print-symbol-def-tree");
648 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-def-tree"; }
650 ::llvm::StringRef getDescription()
const override {
return "Print symbol definition tree."; }
653 static constexpr ::llvm::StringLiteral getPassName() {
654 return ::llvm::StringLiteral(
"SymbolDefTreePrinterPass");
656 ::llvm::StringRef getName()
const override {
return "SymbolDefTreePrinterPass"; }
659 static bool classof(const ::mlir::Pass *pass) {
660 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
664 std::unique_ptr<::mlir::Pass> clonePass()
const override {
665 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
669 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
670 registry.insert<llzk::LLZKDialect>();
671 registry.insert<llzk::boolean::BoolDialect>();
672 registry.insert<llzk::array::ArrayDialect>();
673 registry.insert<llzk::component::StructDialect>();
674 registry.insert<llzk::constrain::ConstrainDialect>();
675 registry.insert<llzk::felt::FeltDialect>();
676 registry.insert<llzk::global::GlobalDialect>();
677 registry.insert<llzk::include::IncludeDialect>();
678 registry.insert<llzk::function::FunctionDialect>();
679 registry.insert<llzk::string::StringDialect>();
680 registry.insert<llzk::polymorphic::PolymorphicDialect>();
681 registry.insert<mlir::arith::ArithDialect>();
682 registry.insert<mlir::scf::SCFDialect>();
688 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolDefTreePrinterPassBase<DerivedT>)
690 SymbolDefTreePrinterPassBase(SymbolDefTreePrinterPassOptions options) : SymbolDefTreePrinterPassBase() {
691 outputStream = std::move(options.outputStream);
692 saveDotGraph = std::move(options.saveDotGraph);
695 ::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(
697 "Print pass output to 'llvm::outs()'"),
699 "Print pass output to 'llvm::errs()'"),
701 "Print pass output to 'llvm::dbgs()'")
703 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
707 return std::make_unique<DerivedT>();
711 return std::make_unique<DerivedT>(std::move(options));
717 return impl::createSymbolDefTreePrinterPass();
721 return impl::createSymbolDefTreePrinterPass(std::move(options));
723#undef GEN_PASS_DEF_SYMBOLDEFTREEPRINTERPASS
729#ifdef GEN_PASS_DECL_SYMBOLUSEGRAPHPRINTERPASS
730struct SymbolUseGraphPrinterPassOptions {
732 bool saveDotGraph =
false;
736#undef GEN_PASS_DECL_SYMBOLUSEGRAPHPRINTERPASS
738#ifdef GEN_PASS_DEF_SYMBOLUSEGRAPHPRINTERPASS
749template <
typename DerivedT>
750class SymbolUseGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
752 using Base = SymbolUseGraphPrinterPassBase;
754 SymbolUseGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
755 SymbolUseGraphPrinterPassBase(
const SymbolUseGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
756 SymbolUseGraphPrinterPassBase& operator=(
const SymbolUseGraphPrinterPassBase &) =
delete;
757 SymbolUseGraphPrinterPassBase(SymbolUseGraphPrinterPassBase &&) =
delete;
758 SymbolUseGraphPrinterPassBase& operator=(SymbolUseGraphPrinterPassBase &&) =
delete;
759 ~SymbolUseGraphPrinterPassBase() =
default;
762 static constexpr ::llvm::StringLiteral getArgumentName() {
763 return ::llvm::StringLiteral(
"llzk-print-symbol-use-graph");
765 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-use-graph"; }
767 ::llvm::StringRef getDescription()
const override {
return "Print symbol use graph."; }
770 static constexpr ::llvm::StringLiteral getPassName() {
771 return ::llvm::StringLiteral(
"SymbolUseGraphPrinterPass");
773 ::llvm::StringRef getName()
const override {
return "SymbolUseGraphPrinterPass"; }
776 static bool classof(const ::mlir::Pass *pass) {
777 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
781 std::unique_ptr<::mlir::Pass> clonePass()
const override {
782 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
786 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
787 registry.insert<llzk::LLZKDialect>();
788 registry.insert<llzk::boolean::BoolDialect>();
789 registry.insert<llzk::array::ArrayDialect>();
790 registry.insert<llzk::component::StructDialect>();
791 registry.insert<llzk::constrain::ConstrainDialect>();
792 registry.insert<llzk::felt::FeltDialect>();
793 registry.insert<llzk::global::GlobalDialect>();
794 registry.insert<llzk::include::IncludeDialect>();
795 registry.insert<llzk::function::FunctionDialect>();
796 registry.insert<llzk::string::StringDialect>();
797 registry.insert<llzk::polymorphic::PolymorphicDialect>();
798 registry.insert<mlir::arith::ArithDialect>();
799 registry.insert<mlir::scf::SCFDialect>();
805 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolUseGraphPrinterPassBase<DerivedT>)
807 SymbolUseGraphPrinterPassBase(SymbolUseGraphPrinterPassOptions options) : SymbolUseGraphPrinterPassBase() {
808 outputStream = std::move(options.outputStream);
809 saveDotGraph = std::move(options.saveDotGraph);
812 ::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(
814 "Print pass output to 'llvm::outs()'"),
816 "Print pass output to 'llvm::errs()'"),
818 "Print pass output to 'llvm::dbgs()'")
820 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
824 return std::make_unique<DerivedT>();
828 return std::make_unique<DerivedT>(std::move(options));
834 return impl::createSymbolUseGraphPrinterPass();
838 return impl::createSymbolUseGraphPrinterPass(std::move(options));
840#undef GEN_PASS_DEF_SYMBOLUSEGRAPHPRINTERPASS
842#ifdef GEN_PASS_REGISTRATION
849 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
856 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
866 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
873 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
883 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
890 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
900 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
907 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
917 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
924 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
934 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
941 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
951 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
958 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
976#undef GEN_PASS_REGISTRATION
979#ifdef GEN_PASS_CLASSES
981template <
typename DerivedT>
982class CallGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
984 using Base = CallGraphPrinterPassBase;
986 CallGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
987 CallGraphPrinterPassBase(
const CallGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
988 CallGraphPrinterPassBase& operator=(
const CallGraphPrinterPassBase &) =
delete;
989 CallGraphPrinterPassBase(CallGraphPrinterPassBase &&) =
delete;
990 CallGraphPrinterPassBase& operator=(CallGraphPrinterPassBase &&) =
delete;
991 ~CallGraphPrinterPassBase() =
default;
994 static constexpr ::llvm::StringLiteral getArgumentName() {
995 return ::llvm::StringLiteral(
"llzk-print-call-graph");
997 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph"; }
999 ::llvm::StringRef getDescription()
const override {
return "Print the LLZK module's call graph."; }
1002 static constexpr ::llvm::StringLiteral getPassName() {
1003 return ::llvm::StringLiteral(
"CallGraphPrinterPass");
1005 ::llvm::StringRef getName()
const override {
return "CallGraphPrinterPass"; }
1008 static bool classof(const ::mlir::Pass *pass) {
1009 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1013 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1014 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1018 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1019 registry.insert<llzk::LLZKDialect>();
1020 registry.insert<llzk::boolean::BoolDialect>();
1021 registry.insert<llzk::array::ArrayDialect>();
1022 registry.insert<llzk::component::StructDialect>();
1023 registry.insert<llzk::constrain::ConstrainDialect>();
1024 registry.insert<llzk::felt::FeltDialect>();
1025 registry.insert<llzk::global::GlobalDialect>();
1026 registry.insert<llzk::include::IncludeDialect>();
1027 registry.insert<llzk::function::FunctionDialect>();
1028 registry.insert<llzk::string::StringDialect>();
1029 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1030 registry.insert<mlir::arith::ArithDialect>();
1031 registry.insert<mlir::scf::SCFDialect>();
1037 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphPrinterPassBase<DerivedT>)
1040 ::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(
1042 "Print pass output to 'llvm::outs()'"),
1044 "Print pass output to 'llvm::errs()'"),
1046 "Print pass output to 'llvm::dbgs()'")
1050template <
typename DerivedT>
1051class CallGraphSCCsPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1053 using Base = CallGraphSCCsPrinterPassBase;
1055 CallGraphSCCsPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1056 CallGraphSCCsPrinterPassBase(
const CallGraphSCCsPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1057 CallGraphSCCsPrinterPassBase& operator=(
const CallGraphSCCsPrinterPassBase &) =
delete;
1058 CallGraphSCCsPrinterPassBase(CallGraphSCCsPrinterPassBase &&) =
delete;
1059 CallGraphSCCsPrinterPassBase& operator=(CallGraphSCCsPrinterPassBase &&) =
delete;
1060 ~CallGraphSCCsPrinterPassBase() =
default;
1063 static constexpr ::llvm::StringLiteral getArgumentName() {
1064 return ::llvm::StringLiteral(
"llzk-print-call-graph-sccs");
1066 ::llvm::StringRef getArgument()
const override {
return "llzk-print-call-graph-sccs"; }
1068 ::llvm::StringRef getDescription()
const override {
return "Print the SCCs from the LLZK module's call graph."; }
1071 static constexpr ::llvm::StringLiteral getPassName() {
1072 return ::llvm::StringLiteral(
"CallGraphSCCsPrinterPass");
1074 ::llvm::StringRef getName()
const override {
return "CallGraphSCCsPrinterPass"; }
1077 static bool classof(const ::mlir::Pass *pass) {
1078 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1082 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1083 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1087 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1088 registry.insert<llzk::LLZKDialect>();
1089 registry.insert<llzk::boolean::BoolDialect>();
1090 registry.insert<llzk::array::ArrayDialect>();
1091 registry.insert<llzk::component::StructDialect>();
1092 registry.insert<llzk::constrain::ConstrainDialect>();
1093 registry.insert<llzk::felt::FeltDialect>();
1094 registry.insert<llzk::global::GlobalDialect>();
1095 registry.insert<llzk::include::IncludeDialect>();
1096 registry.insert<llzk::function::FunctionDialect>();
1097 registry.insert<llzk::string::StringDialect>();
1098 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1099 registry.insert<mlir::arith::ArithDialect>();
1100 registry.insert<mlir::scf::SCFDialect>();
1106 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(CallGraphSCCsPrinterPassBase<DerivedT>)
1109 ::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(
1111 "Print pass output to 'llvm::outs()'"),
1113 "Print pass output to 'llvm::errs()'"),
1115 "Print pass output to 'llvm::dbgs()'")
1119template <
typename DerivedT>
1120class ConstraintDependencyGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1122 using Base = ConstraintDependencyGraphPrinterPassBase;
1124 ConstraintDependencyGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1125 ConstraintDependencyGraphPrinterPassBase(
const ConstraintDependencyGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1126 ConstraintDependencyGraphPrinterPassBase& operator=(
const ConstraintDependencyGraphPrinterPassBase &) =
delete;
1127 ConstraintDependencyGraphPrinterPassBase(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
1128 ConstraintDependencyGraphPrinterPassBase& operator=(ConstraintDependencyGraphPrinterPassBase &&) =
delete;
1129 ~ConstraintDependencyGraphPrinterPassBase() =
default;
1132 static constexpr ::llvm::StringLiteral getArgumentName() {
1133 return ::llvm::StringLiteral(
"llzk-print-constraint-dependency-graphs");
1135 ::llvm::StringRef getArgument()
const override {
return "llzk-print-constraint-dependency-graphs"; }
1137 ::llvm::StringRef getDescription()
const override {
return "Print constraint dependency graph for all LLZK structs."; }
1140 static constexpr ::llvm::StringLiteral getPassName() {
1141 return ::llvm::StringLiteral(
"ConstraintDependencyGraphPrinterPass");
1143 ::llvm::StringRef getName()
const override {
return "ConstraintDependencyGraphPrinterPass"; }
1146 static bool classof(const ::mlir::Pass *pass) {
1147 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1151 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1152 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1156 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1157 registry.insert<llzk::LLZKDialect>();
1158 registry.insert<llzk::boolean::BoolDialect>();
1159 registry.insert<llzk::array::ArrayDialect>();
1160 registry.insert<llzk::component::StructDialect>();
1161 registry.insert<llzk::constrain::ConstrainDialect>();
1162 registry.insert<llzk::felt::FeltDialect>();
1163 registry.insert<llzk::global::GlobalDialect>();
1164 registry.insert<llzk::include::IncludeDialect>();
1165 registry.insert<llzk::function::FunctionDialect>();
1166 registry.insert<llzk::string::StringDialect>();
1167 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1168 registry.insert<mlir::arith::ArithDialect>();
1169 registry.insert<mlir::scf::SCFDialect>();
1175 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ConstraintDependencyGraphPrinterPassBase<DerivedT>)
1178 ::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(
1180 "Print pass output to 'llvm::outs()'"),
1182 "Print pass output to 'llvm::errs()'"),
1184 "Print pass output to 'llvm::dbgs()'")
1186 ::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)};
1189template <
typename DerivedT>
1190class IntervalAnalysisPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1192 using Base = IntervalAnalysisPrinterPassBase;
1194 IntervalAnalysisPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1195 IntervalAnalysisPrinterPassBase(
const IntervalAnalysisPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1196 IntervalAnalysisPrinterPassBase& operator=(
const IntervalAnalysisPrinterPassBase &) =
delete;
1197 IntervalAnalysisPrinterPassBase(IntervalAnalysisPrinterPassBase &&) =
delete;
1198 IntervalAnalysisPrinterPassBase& operator=(IntervalAnalysisPrinterPassBase &&) =
delete;
1199 ~IntervalAnalysisPrinterPassBase() =
default;
1202 static constexpr ::llvm::StringLiteral getArgumentName() {
1203 return ::llvm::StringLiteral(
"llzk-print-interval-analysis");
1205 ::llvm::StringRef getArgument()
const override {
return "llzk-print-interval-analysis"; }
1207 ::llvm::StringRef getDescription()
const override {
return "Print interval analysis results for all LLZK structs."; }
1210 static constexpr ::llvm::StringLiteral getPassName() {
1211 return ::llvm::StringLiteral(
"IntervalAnalysisPrinterPass");
1213 ::llvm::StringRef getName()
const override {
return "IntervalAnalysisPrinterPass"; }
1216 static bool classof(const ::mlir::Pass *pass) {
1217 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1221 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1222 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1226 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1227 registry.insert<llzk::LLZKDialect>();
1228 registry.insert<llzk::boolean::BoolDialect>();
1229 registry.insert<llzk::array::ArrayDialect>();
1230 registry.insert<llzk::component::StructDialect>();
1231 registry.insert<llzk::constrain::ConstrainDialect>();
1232 registry.insert<llzk::felt::FeltDialect>();
1233 registry.insert<llzk::global::GlobalDialect>();
1234 registry.insert<llzk::include::IncludeDialect>();
1235 registry.insert<llzk::function::FunctionDialect>();
1236 registry.insert<llzk::string::StringDialect>();
1237 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1238 registry.insert<mlir::arith::ArithDialect>();
1239 registry.insert<mlir::scf::SCFDialect>();
1245 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(IntervalAnalysisPrinterPassBase<DerivedT>)
1248 ::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(
1250 "Print pass output to 'llvm::outs()'"),
1252 "Print pass output to 'llvm::errs()'"),
1254 "Print pass output to 'llvm::dbgs()'")
1256 ::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, grumpkin, koalabear, mersenne31"), ::llvm::cl::init(
"")};
1257 ::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)};
1258 ::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)};
1259 ::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)};
1260 ::mlir::Pass::Option<bool> printUnreducedIntervals{*
this,
"print-unreduced-intervals", ::llvm::cl::desc(
"Whether to print tracked unreduced intervals alongside reduced interval summaries."), ::llvm::cl::init(
false)};
1261 ::mlir::Pass::Option<bool> printSSAIntervals{*
this,
"print-ssa-intervals", ::llvm::cl::desc(
"Whether to print per-SSA intervals for function arguments and scalar op results."), ::llvm::cl::init(
false)};
1264template <
typename DerivedT>
1265class PredecessorPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1267 using Base = PredecessorPrinterPassBase;
1269 PredecessorPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1270 PredecessorPrinterPassBase(
const PredecessorPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1271 PredecessorPrinterPassBase& operator=(
const PredecessorPrinterPassBase &) =
delete;
1272 PredecessorPrinterPassBase(PredecessorPrinterPassBase &&) =
delete;
1273 PredecessorPrinterPassBase& operator=(PredecessorPrinterPassBase &&) =
delete;
1274 ~PredecessorPrinterPassBase() =
default;
1277 static constexpr ::llvm::StringLiteral getArgumentName() {
1278 return ::llvm::StringLiteral(
"llzk-print-predecessors");
1280 ::llvm::StringRef getArgument()
const override {
return "llzk-print-predecessors"; }
1282 ::llvm::StringRef getDescription()
const override {
return "Print the predecessors of all operations."; }
1285 static constexpr ::llvm::StringLiteral getPassName() {
1286 return ::llvm::StringLiteral(
"PredecessorPrinterPass");
1288 ::llvm::StringRef getName()
const override {
return "PredecessorPrinterPass"; }
1291 static bool classof(const ::mlir::Pass *pass) {
1292 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1296 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1297 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1301 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1302 registry.insert<llzk::LLZKDialect>();
1303 registry.insert<llzk::boolean::BoolDialect>();
1304 registry.insert<llzk::array::ArrayDialect>();
1305 registry.insert<llzk::component::StructDialect>();
1306 registry.insert<llzk::constrain::ConstrainDialect>();
1307 registry.insert<llzk::felt::FeltDialect>();
1308 registry.insert<llzk::global::GlobalDialect>();
1309 registry.insert<llzk::include::IncludeDialect>();
1310 registry.insert<llzk::function::FunctionDialect>();
1311 registry.insert<llzk::string::StringDialect>();
1312 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1313 registry.insert<mlir::arith::ArithDialect>();
1314 registry.insert<mlir::scf::SCFDialect>();
1320 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(PredecessorPrinterPassBase<DerivedT>)
1323 ::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(
1325 "Print pass output to 'llvm::outs()'"),
1327 "Print pass output to 'llvm::errs()'"),
1329 "Print pass output to 'llvm::dbgs()'")
1331 ::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)};
1334template <
typename DerivedT>
1335class SymbolDefTreePrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1337 using Base = SymbolDefTreePrinterPassBase;
1339 SymbolDefTreePrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1340 SymbolDefTreePrinterPassBase(
const SymbolDefTreePrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1341 SymbolDefTreePrinterPassBase& operator=(
const SymbolDefTreePrinterPassBase &) =
delete;
1342 SymbolDefTreePrinterPassBase(SymbolDefTreePrinterPassBase &&) =
delete;
1343 SymbolDefTreePrinterPassBase& operator=(SymbolDefTreePrinterPassBase &&) =
delete;
1344 ~SymbolDefTreePrinterPassBase() =
default;
1347 static constexpr ::llvm::StringLiteral getArgumentName() {
1348 return ::llvm::StringLiteral(
"llzk-print-symbol-def-tree");
1350 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-def-tree"; }
1352 ::llvm::StringRef getDescription()
const override {
return "Print symbol definition tree."; }
1355 static constexpr ::llvm::StringLiteral getPassName() {
1356 return ::llvm::StringLiteral(
"SymbolDefTreePrinterPass");
1358 ::llvm::StringRef getName()
const override {
return "SymbolDefTreePrinterPass"; }
1361 static bool classof(const ::mlir::Pass *pass) {
1362 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1366 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1367 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1371 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1372 registry.insert<llzk::LLZKDialect>();
1373 registry.insert<llzk::boolean::BoolDialect>();
1374 registry.insert<llzk::array::ArrayDialect>();
1375 registry.insert<llzk::component::StructDialect>();
1376 registry.insert<llzk::constrain::ConstrainDialect>();
1377 registry.insert<llzk::felt::FeltDialect>();
1378 registry.insert<llzk::global::GlobalDialect>();
1379 registry.insert<llzk::include::IncludeDialect>();
1380 registry.insert<llzk::function::FunctionDialect>();
1381 registry.insert<llzk::string::StringDialect>();
1382 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1383 registry.insert<mlir::arith::ArithDialect>();
1384 registry.insert<mlir::scf::SCFDialect>();
1390 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolDefTreePrinterPassBase<DerivedT>)
1393 ::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(
1395 "Print pass output to 'llvm::outs()'"),
1397 "Print pass output to 'llvm::errs()'"),
1399 "Print pass output to 'llvm::dbgs()'")
1401 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
1404template <
typename DerivedT>
1405class SymbolUseGraphPrinterPassBase :
public ::mlir::OperationPass<::mlir::ModuleOp> {
1407 using Base = SymbolUseGraphPrinterPassBase;
1409 SymbolUseGraphPrinterPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
1410 SymbolUseGraphPrinterPassBase(
const SymbolUseGraphPrinterPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
1411 SymbolUseGraphPrinterPassBase& operator=(
const SymbolUseGraphPrinterPassBase &) =
delete;
1412 SymbolUseGraphPrinterPassBase(SymbolUseGraphPrinterPassBase &&) =
delete;
1413 SymbolUseGraphPrinterPassBase& operator=(SymbolUseGraphPrinterPassBase &&) =
delete;
1414 ~SymbolUseGraphPrinterPassBase() =
default;
1417 static constexpr ::llvm::StringLiteral getArgumentName() {
1418 return ::llvm::StringLiteral(
"llzk-print-symbol-use-graph");
1420 ::llvm::StringRef getArgument()
const override {
return "llzk-print-symbol-use-graph"; }
1422 ::llvm::StringRef getDescription()
const override {
return "Print symbol use graph."; }
1425 static constexpr ::llvm::StringLiteral getPassName() {
1426 return ::llvm::StringLiteral(
"SymbolUseGraphPrinterPass");
1428 ::llvm::StringRef getName()
const override {
return "SymbolUseGraphPrinterPass"; }
1431 static bool classof(const ::mlir::Pass *pass) {
1432 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
1436 std::unique_ptr<::mlir::Pass> clonePass()
const override {
1437 return std::make_unique<DerivedT>(*
static_cast<const DerivedT *
>(
this));
1441 void getDependentDialects(::mlir::DialectRegistry ®istry)
const override {
1442 registry.insert<llzk::LLZKDialect>();
1443 registry.insert<llzk::boolean::BoolDialect>();
1444 registry.insert<llzk::array::ArrayDialect>();
1445 registry.insert<llzk::component::StructDialect>();
1446 registry.insert<llzk::constrain::ConstrainDialect>();
1447 registry.insert<llzk::felt::FeltDialect>();
1448 registry.insert<llzk::global::GlobalDialect>();
1449 registry.insert<llzk::include::IncludeDialect>();
1450 registry.insert<llzk::function::FunctionDialect>();
1451 registry.insert<llzk::string::StringDialect>();
1452 registry.insert<llzk::polymorphic::PolymorphicDialect>();
1453 registry.insert<mlir::arith::ArithDialect>();
1454 registry.insert<mlir::scf::SCFDialect>();
1460 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SymbolUseGraphPrinterPassBase<DerivedT>)
1463 ::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(
1465 "Print pass output to 'llvm::outs()'"),
1467 "Print pass output to 'llvm::errs()'"),
1469 "Print pass output to 'llvm::dbgs()'")
1471 ::mlir::Pass::Option<bool> saveDotGraph{*
this,
"saveDot", ::llvm::cl::desc(
"Whether to dump the graph to DOT format."), ::llvm::cl::init(
false)};
1473#undef GEN_PASS_CLASSES
std::unique_ptr<::mlir::Pass > createConstraintDependencyGraphPrinterPass()
std::unique_ptr<::mlir::Pass > createPredecessorPrinterPass()
std::unique_ptr<::mlir::Pass > createSymbolUseGraphPrinterPass()
std::unique_ptr<::mlir::Pass > createIntervalAnalysisPrinterPass()
std::unique_ptr<::mlir::Pass > createCallGraphSCCsPrinterPass()
std::unique_ptr<::mlir::Pass > createSymbolDefTreePrinterPass()
std::unique_ptr<::mlir::Pass > createCallGraphPrinterPass()
void registerIntervalAnalysisPrinterPassPass()
void registerSymbolDefTreePrinterPassPass()
void registerPredecessorPrinterPassPass()
void registerIntervalAnalysisPrinterPass()
void registerSymbolUseGraphPrinterPassPass()
void registerCallGraphPrinterPass()
void registerConstraintDependencyGraphPrinterPass()
void registerSymbolUseGraphPrinterPass()
void registerCallGraphPrinterPassPass()
::llvm::StringRef stringifyOutputStream(OutputStream val)
void registerPredecessorPrinterPass()
void registerCallGraphSCCsPrinterPass()
void registerConstraintDependencyGraphPrinterPassPass()
void registerCallGraphSCCsPrinterPassPass()
void registerAnalysisPasses()
void registerSymbolDefTreePrinterPass()