LLZK 3.0.0
An open-source IR for Zero Knowledge (ZK) circuits
Loading...
Searching...
No Matches
TransformationPasses.h.inc
Go to the documentation of this file.
1/* Autogenerated by mlir-tblgen; don't manually edit */
2
3#ifdef GEN_PASS_DECL
4// Generate declarations for all passes.
5#define GEN_PASS_DECL_ARRAYTOSCALARPASS
6#define GEN_PASS_DECL_STRAIGHTLINESTATICARRAYPROMOTIONPASS
7#undef GEN_PASS_DECL
8#endif // GEN_PASS_DECL
9
10//===----------------------------------------------------------------------===//
11// ArrayToScalarPass
12//===----------------------------------------------------------------------===//
13#ifdef GEN_PASS_DECL_ARRAYTOSCALARPASS
14std::unique_ptr<::mlir::Pass> createArrayToScalarPass();
15#undef GEN_PASS_DECL_ARRAYTOSCALARPASS
16#endif // GEN_PASS_DECL_ARRAYTOSCALARPASS
17#ifdef GEN_PASS_DEF_ARRAYTOSCALARPASS
18
19namespace impl {
20 std::unique_ptr<::mlir::Pass> createArrayToScalarPass();
21} // namespace impl
22namespace impl {
23
24template <typename DerivedT>
25class ArrayToScalarPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
26public:
27 using Base = ArrayToScalarPassBase;
28
29 ArrayToScalarPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
30 ArrayToScalarPassBase(const ArrayToScalarPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
31 ArrayToScalarPassBase& operator=(const ArrayToScalarPassBase &) = delete;
32 ArrayToScalarPassBase(ArrayToScalarPassBase &&) = delete;
33 ArrayToScalarPassBase& operator=(ArrayToScalarPassBase &&) = delete;
34 ~ArrayToScalarPassBase() = default;
35
37 static constexpr ::llvm::StringLiteral getArgumentName() {
38 return ::llvm::StringLiteral("llzk-array-to-scalar");
39 }
40 ::llvm::StringRef getArgument() const override { return "llzk-array-to-scalar"; }
41
42 ::llvm::StringRef getDescription() const override { return R"PD(Replace arrays with scalar values)PD"; }
43
45 static constexpr ::llvm::StringLiteral getPassName() {
46 return ::llvm::StringLiteral("ArrayToScalarPass");
47 }
48 ::llvm::StringRef getName() const override { return "ArrayToScalarPass"; }
49
51 static bool classof(const ::mlir::Pass *pass) {
52 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
53 }
54
56 std::unique_ptr<::mlir::Pass> clonePass() const override {
57 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
58 }
59
61 void getDependentDialects(::mlir::DialectRegistry &registry) 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>();
75 }
76
80 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArrayToScalarPassBase<DerivedT>)
81
82protected:
83private:
84
85 friend std::unique_ptr<::mlir::Pass> createArrayToScalarPass() {
86 return std::make_unique<DerivedT>();
87 }
88};
89} // namespace impl
90
91std::unique_ptr<::mlir::Pass> createArrayToScalarPass() {
92 return impl::createArrayToScalarPass();
93}
94#undef GEN_PASS_DEF_ARRAYTOSCALARPASS
95#endif // GEN_PASS_DEF_ARRAYTOSCALARPASS
96
97//===----------------------------------------------------------------------===//
98// StraightLineStaticArrayPromotionPass
99//===----------------------------------------------------------------------===//
100#ifdef GEN_PASS_DECL_STRAIGHTLINESTATICARRAYPROMOTIONPASS
101std::unique_ptr<::mlir::Pass> createStraightLineStaticArrayPromotionPass();
102#undef GEN_PASS_DECL_STRAIGHTLINESTATICARRAYPROMOTIONPASS
103#endif // GEN_PASS_DECL_STRAIGHTLINESTATICARRAYPROMOTIONPASS
104#ifdef GEN_PASS_DEF_STRAIGHTLINESTATICARRAYPROMOTIONPASS
105
106namespace impl {
107 std::unique_ptr<::mlir::Pass> createStraightLineStaticArrayPromotionPass();
108} // namespace impl
109namespace impl {
110
111template <typename DerivedT>
112class StraightLineStaticArrayPromotionPassBase : public ::mlir::OperationPass<::mlir::ModuleOp> {
113public:
114 using Base = StraightLineStaticArrayPromotionPassBase;
115
116 StraightLineStaticArrayPromotionPassBase() : ::mlir::OperationPass<::mlir::ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
117 StraightLineStaticArrayPromotionPassBase(const StraightLineStaticArrayPromotionPassBase &other) : ::mlir::OperationPass<::mlir::ModuleOp>(other) {}
118 StraightLineStaticArrayPromotionPassBase& operator=(const StraightLineStaticArrayPromotionPassBase &) = delete;
119 StraightLineStaticArrayPromotionPassBase(StraightLineStaticArrayPromotionPassBase &&) = delete;
120 StraightLineStaticArrayPromotionPassBase& operator=(StraightLineStaticArrayPromotionPassBase &&) = delete;
121 ~StraightLineStaticArrayPromotionPassBase() = default;
122
124 static constexpr ::llvm::StringLiteral getArgumentName() {
125 return ::llvm::StringLiteral("llzk-straight-line-static-array-promotion");
126 }
127 ::llvm::StringRef getArgument() const override { return "llzk-straight-line-static-array-promotion"; }
128
129 ::llvm::StringRef getDescription() const override { return R"PD(Promote straight-line static array accesses to SSA values)PD"; }
130
132 static constexpr ::llvm::StringLiteral getPassName() {
133 return ::llvm::StringLiteral("StraightLineStaticArrayPromotionPass");
134 }
135 ::llvm::StringRef getName() const override { return "StraightLineStaticArrayPromotionPass"; }
136
138 static bool classof(const ::mlir::Pass *pass) {
139 return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
140 }
141
143 std::unique_ptr<::mlir::Pass> clonePass() const override {
144 return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
145 }
146
148 void getDependentDialects(::mlir::DialectRegistry &registry) const override {
149 registry.insert<llzk::LLZKDialect>();
150 registry.insert<llzk::boolean::BoolDialect>();
151 registry.insert<llzk::array::ArrayDialect>();
152 registry.insert<llzk::component::StructDialect>();
153 registry.insert<llzk::constrain::ConstrainDialect>();
154 registry.insert<llzk::felt::FeltDialect>();
155 registry.insert<llzk::global::GlobalDialect>();
156 registry.insert<llzk::include::IncludeDialect>();
157 registry.insert<llzk::function::FunctionDialect>();
158 registry.insert<llzk::string::StringDialect>();
159 registry.insert<llzk::polymorphic::PolymorphicDialect>();
160 registry.insert<mlir::arith::ArithDialect>();
161 registry.insert<mlir::scf::SCFDialect>();
162 }
163
167 MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(StraightLineStaticArrayPromotionPassBase<DerivedT>)
168
169protected:
170private:
171
172 friend std::unique_ptr<::mlir::Pass> createStraightLineStaticArrayPromotionPass() {
173 return std::make_unique<DerivedT>();
174 }
175};
176} // namespace impl
177
178std::unique_ptr<::mlir::Pass> createStraightLineStaticArrayPromotionPass() {
179 return impl::createStraightLineStaticArrayPromotionPass();
180}
181#undef GEN_PASS_DEF_STRAIGHTLINESTATICARRAYPROMOTIONPASS
182#endif // GEN_PASS_DEF_STRAIGHTLINESTATICARRAYPROMOTIONPASS
183#ifdef GEN_PASS_REGISTRATION
184// Generate registrations for all passes.
185#define GEN_PASS_REGISTRATION_ARRAYTOSCALARPASS
186#define GEN_PASS_REGISTRATION_STRAIGHTLINESTATICARRAYPROMOTIONPASS
187#endif // GEN_PASS_REGISTRATION
188
189//===----------------------------------------------------------------------===//
190// ArrayToScalarPass Registration
191//===----------------------------------------------------------------------===//
192#ifdef GEN_PASS_REGISTRATION_ARRAYTOSCALARPASS
193
194inline void registerArrayToScalarPass() {
195 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
197 });
198}
199
200// Old registration code, kept for temporary backwards compatibility.
201inline void registerArrayToScalarPassPass() {
202 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
204 });
205}
206
207#undef GEN_PASS_REGISTRATION_ARRAYTOSCALARPASS
208#endif // GEN_PASS_REGISTRATION_ARRAYTOSCALARPASS
209
210//===----------------------------------------------------------------------===//
211// StraightLineStaticArrayPromotionPass Registration
212//===----------------------------------------------------------------------===//
213#ifdef GEN_PASS_REGISTRATION_STRAIGHTLINESTATICARRAYPROMOTIONPASS
214
216 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
218 });
219}
220
221// Old registration code, kept for temporary backwards compatibility.
223 ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
225 });
226}
227
228#undef GEN_PASS_REGISTRATION_STRAIGHTLINESTATICARRAYPROMOTIONPASS
229#endif // GEN_PASS_REGISTRATION_STRAIGHTLINESTATICARRAYPROMOTIONPASS
230#ifdef GEN_PASS_REGISTRATION
231
232//===----------------------------------------------------------------------===//
233// Transformation Registration
234//===----------------------------------------------------------------------===//
235
236inline void registerTransformationPasses() {
239}
240#undef GEN_PASS_REGISTRATION
241#endif // GEN_PASS_REGISTRATION
242#ifdef GEN_PASS_CLASSES
243#error "GEN_PASS_CLASSES is deprecated; use per-pass macros"
244#undef GEN_PASS_CLASSES
245#endif // GEN_PASS_CLASSES
std::unique_ptr<::mlir::Pass > createArrayToScalarPass()
std::unique_ptr<::mlir::Pass > createStraightLineStaticArrayPromotionPass()
void registerArrayToScalarPass()
void registerStraightLineStaticArrayPromotionPass()
void registerArrayToScalarPassPass()
void registerStraightLineStaticArrayPromotionPassPass()
void registerTransformationPasses()