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 R
"PD(Print the LLZK module's call graph.)PD"; }
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(R
"PO(Specifies the stream to which the pass prints.)PO"), ::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 R
"PD(Print the SCCs from the LLZK module's call graph.)PD"; }
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(R
"PO(Specifies the stream to which the pass prints.)PO"), ::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 R
"PD(Print constraint dependency graph for all LLZK structs.)PD"; }
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(R
"PO(Specifies the stream to which the pass prints.)PO"), ::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(R
"PO(Whether to run the analysis intra-procedurally only (default is false).)PO"), ::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 R
"PD(Print interval analysis results for all LLZK structs.)PD"; }
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(R
"PO(Specifies the stream to which the pass prints.)PO"), ::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(R
"PO(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. Constants retain their declared-field meaning before reduction in the analysis field; fieldless literals use the analysis field directly. Supported fields: bn128/bn254, babybear, goldilocks, grumpkin, koalabear, mersenne31)PO"), ::llvm::cl::init("")};
465 ::mlir::Pass::Option<bool> propagateInputConstraints{*
this,
"propagate-input-constraints", ::llvm::cl::desc(R
"PO(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.)PO"), ::llvm::cl::init(false)};
466 ::mlir::Pass::Option<bool> printSolverConstraints{*
this,
"print-solver-constraints", ::llvm::cl::desc(R
"PO(Whether to output SMT solver constraints along with intervals.)PO"), ::llvm::cl::init(false)};
467 ::mlir::Pass::Option<bool> printComputeIntervals{*
this,
"print-compute-intervals", ::llvm::cl::desc(R
"PO(Whether to print compute function intervals (default only prints constrain function intervals).)PO"), ::llvm::cl::init(false)};
468 ::mlir::Pass::Option<bool> printUnreducedIntervals{*
this,
"print-unreduced-intervals", ::llvm::cl::desc(R
"PO(Whether to print tracked unreduced intervals alongside reduced interval summaries.)PO"), ::llvm::cl::init(false)};
469 ::mlir::Pass::Option<bool> printSSAIntervals{*
this,
"print-ssa-intervals", ::llvm::cl::desc(R
"PO(Whether to print per-SSA intervals for function arguments and scalar op results.)PO"), ::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 R
"PD(Print the predecessors of all operations.)PD"; }
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(R
"PO(Specifies the stream to which the pass prints.)PO"), ::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(R
"PO(Whether to pre-run the required dataflow analyses (e.g., liveness analysis).)PO"), ::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 R
"PD(Print symbol definition tree.)PD"; }
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(R
"PO(Specifies the stream to which the pass prints.)PO"), ::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(R
"PO(Whether to dump the graph to DOT format.)PO"), ::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 R
"PD(Print symbol use graph.)PD"; }
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(R
"PO(Specifies the stream to which the pass prints.)PO"), ::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(R
"PO(Whether to dump the graph to DOT format.)PO"), ::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
844#define GEN_PASS_REGISTRATION_CALLGRAPHPRINTERPASS
845#define GEN_PASS_REGISTRATION_CALLGRAPHSCCSPRINTERPASS
846#define GEN_PASS_REGISTRATION_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
847#define GEN_PASS_REGISTRATION_INTERVALANALYSISPRINTERPASS
848#define GEN_PASS_REGISTRATION_PREDECESSORPRINTERPASS
849#define GEN_PASS_REGISTRATION_SYMBOLDEFTREEPRINTERPASS
850#define GEN_PASS_REGISTRATION_SYMBOLUSEGRAPHPRINTERPASS
856#ifdef GEN_PASS_REGISTRATION_CALLGRAPHPRINTERPASS
859 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
866 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
871#undef GEN_PASS_REGISTRATION_CALLGRAPHPRINTERPASS
877#ifdef GEN_PASS_REGISTRATION_CALLGRAPHSCCSPRINTERPASS
880 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
887 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
892#undef GEN_PASS_REGISTRATION_CALLGRAPHSCCSPRINTERPASS
898#ifdef GEN_PASS_REGISTRATION_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
901 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
908 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
913#undef GEN_PASS_REGISTRATION_CONSTRAINTDEPENDENCYGRAPHPRINTERPASS
919#ifdef GEN_PASS_REGISTRATION_INTERVALANALYSISPRINTERPASS
922 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
929 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
934#undef GEN_PASS_REGISTRATION_INTERVALANALYSISPRINTERPASS
940#ifdef GEN_PASS_REGISTRATION_PREDECESSORPRINTERPASS
943 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
950 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
955#undef GEN_PASS_REGISTRATION_PREDECESSORPRINTERPASS
961#ifdef GEN_PASS_REGISTRATION_SYMBOLDEFTREEPRINTERPASS
964 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
971 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
976#undef GEN_PASS_REGISTRATION_SYMBOLDEFTREEPRINTERPASS
982#ifdef GEN_PASS_REGISTRATION_SYMBOLUSEGRAPHPRINTERPASS
985 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
992 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
997#undef GEN_PASS_REGISTRATION_SYMBOLUSEGRAPHPRINTERPASS
999#ifdef GEN_PASS_REGISTRATION
1014#undef GEN_PASS_REGISTRATION
1016#ifdef GEN_PASS_CLASSES
1017#error "GEN_PASS_CLASSES is deprecated; use per-pass macros"
1018#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()