MimIR
MimIR is my Intermediate Representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <mim/axm.h>
4#include <mim/plugin.h>
5
6/// @namespace mim::plug::compile @ref compile
7namespace mim {
8namespace plug::compile {
9
10static constexpr plugin_t Plugin_Id = 0x11039128d1800000;
11
12/// @name %%compile.Phase
13///@{
14enum class Phase : flags_t {
15};
16
17///@}
18
19/// @name %%compile.Pass
20///@{
21enum class Pass : flags_t {
22};
23
24///@}
25
26/// @name %%compile.Repl
27///@{
28enum class Repl : flags_t {
29};
30
31///@}
32
33/// @name %%compile.is_loaded
34///@{
35enum class is_loaded : flags_t {
36};
37
38const Def* normalize_is_loaded(const Def*, const Def*, const Def*);
39///@}
40
41/// @name %%compile.named_phase
42///@{
43enum class named_phase : flags_t {
44};
45
46///@}
47
48/// @name %%compile.named_pass
49///@{
50enum class named_pass : flags_t {
51};
52
53///@}
54
55/// @name %%compile.named_repl
56///@{
57enum class named_repl : flags_t {
58};
59
60///@}
61
62/// @name %%compile.cond_phase
63///@{
64enum class cond_phase : flags_t {
65};
66
67const Def* normalize_cond_phase(const Def*, const Def*, const Def*);
68///@}
69
70/// @name %%compile.phases
71///@{
72enum class phases : flags_t {
73};
74
75///@}
76
77/// @name %%compile.passes
78///@{
79enum class passes : flags_t {
80};
81
82///@}
83
84/// @name %%compile.repls
85///@{
86enum class repls : flags_t {
87};
88
89///@}
90
91/// @name %%compile.beta_red_phase
92///@{
93enum class beta_red_phase : flags_t {
94};
95
96///@}
97
98/// @name %%compile.branch_normalize_phase
99///@{
101};
102
103///@}
104
105/// @name %%compile.cleanup_phase
106///@{
107enum class cleanup_phase : flags_t {
108};
109
110///@}
111
112/// @name %%compile.eta_exp_phase
113///@{
114enum class eta_exp_phase : flags_t {
115};
116
117///@}
118
119/// @name %%compile.eta_red_phase
120///@{
121enum class eta_red_phase : flags_t {
122};
123
124///@}
125
126/// @name %%compile.null_phase
127///@{
128enum class null_phase : flags_t {
129};
130
131///@}
132
133/// @name %%compile.ret_wrap_phase
134///@{
136};
137
138///@}
139
140/// @name %%compile.sym_expr_opt
141///@{
142enum class sym_expr_opt : flags_t {
143};
144
145///@}
146
147/// @name %%compile.pass2phase
148///@{
149enum class pass2phase : flags_t {
150};
151
152///@}
153
154/// @name %%compile.repl2phase
155///@{
156enum class repl2phase : flags_t {
157};
158
159///@}
160
161/// @name %%compile.prefix_cleanup_phase
162///@{
164};
165
166///@}
167
168/// @name %%compile.internal_cleanup_phase
169///@{
171};
172
173///@}
174
175/// @name %%compile.null_repl
176///@{
177enum class null_repl : flags_t {
178};
179
180///@}
181
182/// @name %%compile.beta_red_pass
183///@{
184enum class beta_red_pass : flags_t {
185};
186
187///@}
188
189/// @name %%compile.eta_exp_pass
190///@{
191enum class eta_exp_pass : flags_t {
192};
193
194///@}
195
196/// @name %%compile.eta_red_pass
197///@{
198enum class eta_red_pass : flags_t {
199};
200
201///@}
202
203/// @name %%compile.lam_spec_pass
204///@{
205enum class lam_spec_pass : flags_t {
206};
207
208///@}
209
210/// @name %%compile.null_pass
211///@{
212enum class null_pass : flags_t {
213};
214
215///@}
216
217/// @name %%compile.scalarize_pass
218///@{
220};
221
222///@}
223
224/// @name %%compile.tail_rec_elim_pass
225///@{
227};
228
229///@}
230
232
233#define MIM_compile_NORMALIZER_IMPL \
234 void register_normalizers(Normalizers& normalizers) {\
235 normalizers[flags_t(Annex::Base<is_loaded>)] = &normalize_is_loaded; \
236 normalizers[flags_t(Annex::Base<cond_phase>)] = &normalize_cond_phase; \
237 }
238} // namespace plug::compile
239
240#ifndef DOXYGEN // don't include in Doxygen documentation
241
242template<> constexpr flags_t Annex::Base<plug::compile::Phase> = 0x11039128d1800000;
243template<> constexpr size_t Annex::Num<plug::compile::Phase> = 0;
244template<> constexpr flags_t Annex::Base<plug::compile::Pass> = 0x11039128d1800100;
245template<> constexpr size_t Annex::Num<plug::compile::Pass> = 0;
246template<> constexpr flags_t Annex::Base<plug::compile::Repl> = 0x11039128d1800200;
247template<> constexpr size_t Annex::Num<plug::compile::Repl> = 0;
248template<> constexpr flags_t Annex::Base<plug::compile::is_loaded> = 0x11039128d1800300;
249template<> constexpr size_t Annex::Num<plug::compile::is_loaded> = 0;
250template<> constexpr flags_t Annex::Base<plug::compile::named_phase> = 0x11039128d1800400;
251template<> constexpr size_t Annex::Num<plug::compile::named_phase> = 0;
252template<> constexpr flags_t Annex::Base<plug::compile::named_pass> = 0x11039128d1800500;
253template<> constexpr size_t Annex::Num<plug::compile::named_pass> = 0;
254template<> constexpr flags_t Annex::Base<plug::compile::named_repl> = 0x11039128d1800600;
255template<> constexpr size_t Annex::Num<plug::compile::named_repl> = 0;
256template<> constexpr flags_t Annex::Base<plug::compile::cond_phase> = 0x11039128d1800700;
257template<> constexpr size_t Annex::Num<plug::compile::cond_phase> = 0;
258template<> constexpr flags_t Annex::Base<plug::compile::phases> = 0x11039128d1800800;
259template<> constexpr size_t Annex::Num<plug::compile::phases> = 0;
260template<> constexpr flags_t Annex::Base<plug::compile::passes> = 0x11039128d1800900;
261template<> constexpr size_t Annex::Num<plug::compile::passes> = 0;
262template<> constexpr flags_t Annex::Base<plug::compile::repls> = 0x11039128d1800a00;
263template<> constexpr size_t Annex::Num<plug::compile::repls> = 0;
264template<> constexpr flags_t Annex::Base<plug::compile::beta_red_phase> = 0x11039128d1800b00;
265template<> constexpr size_t Annex::Num<plug::compile::beta_red_phase> = 0;
266template<> constexpr flags_t Annex::Base<plug::compile::branch_normalize_phase> = 0x11039128d1800c00;
267template<> constexpr size_t Annex::Num<plug::compile::branch_normalize_phase> = 0;
268template<> constexpr flags_t Annex::Base<plug::compile::cleanup_phase> = 0x11039128d1800d00;
269template<> constexpr size_t Annex::Num<plug::compile::cleanup_phase> = 0;
270template<> constexpr flags_t Annex::Base<plug::compile::eta_exp_phase> = 0x11039128d1800e00;
271template<> constexpr size_t Annex::Num<plug::compile::eta_exp_phase> = 0;
272template<> constexpr flags_t Annex::Base<plug::compile::eta_red_phase> = 0x11039128d1800f00;
273template<> constexpr size_t Annex::Num<plug::compile::eta_red_phase> = 0;
274template<> constexpr flags_t Annex::Base<plug::compile::null_phase> = 0x11039128d1801000;
275template<> constexpr size_t Annex::Num<plug::compile::null_phase> = 0;
276template<> constexpr flags_t Annex::Base<plug::compile::ret_wrap_phase> = 0x11039128d1801100;
277template<> constexpr size_t Annex::Num<plug::compile::ret_wrap_phase> = 0;
278template<> constexpr flags_t Annex::Base<plug::compile::sym_expr_opt> = 0x11039128d1801200;
279template<> constexpr size_t Annex::Num<plug::compile::sym_expr_opt> = 0;
280template<> constexpr flags_t Annex::Base<plug::compile::pass2phase> = 0x11039128d1801300;
281template<> constexpr size_t Annex::Num<plug::compile::pass2phase> = 0;
282template<> constexpr flags_t Annex::Base<plug::compile::repl2phase> = 0x11039128d1801400;
283template<> constexpr size_t Annex::Num<plug::compile::repl2phase> = 0;
284template<> constexpr flags_t Annex::Base<plug::compile::prefix_cleanup_phase> = 0x11039128d1801500;
285template<> constexpr size_t Annex::Num<plug::compile::prefix_cleanup_phase> = 0;
286template<> constexpr flags_t Annex::Base<plug::compile::internal_cleanup_phase> = 0x11039128d1801600;
287template<> constexpr size_t Annex::Num<plug::compile::internal_cleanup_phase> = 0;
288template<> constexpr flags_t Annex::Base<plug::compile::null_repl> = 0x11039128d1801700;
289template<> constexpr size_t Annex::Num<plug::compile::null_repl> = 0;
290template<> constexpr flags_t Annex::Base<plug::compile::beta_red_pass> = 0x11039128d1801800;
291template<> constexpr size_t Annex::Num<plug::compile::beta_red_pass> = 0;
292template<> constexpr flags_t Annex::Base<plug::compile::eta_exp_pass> = 0x11039128d1801900;
293template<> constexpr size_t Annex::Num<plug::compile::eta_exp_pass> = 0;
294template<> constexpr flags_t Annex::Base<plug::compile::eta_red_pass> = 0x11039128d1801a00;
295template<> constexpr size_t Annex::Num<plug::compile::eta_red_pass> = 0;
296template<> constexpr flags_t Annex::Base<plug::compile::lam_spec_pass> = 0x11039128d1801b00;
297template<> constexpr size_t Annex::Num<plug::compile::lam_spec_pass> = 0;
298template<> constexpr flags_t Annex::Base<plug::compile::null_pass> = 0x11039128d1801c00;
299template<> constexpr size_t Annex::Num<plug::compile::null_pass> = 0;
300template<> constexpr flags_t Annex::Base<plug::compile::scalarize_pass> = 0x11039128d1801d00;
301template<> constexpr size_t Annex::Num<plug::compile::scalarize_pass> = 0;
302template<> constexpr flags_t Annex::Base<plug::compile::tail_rec_elim_pass> = 0x11039128d1801e00;
303template<> constexpr size_t Annex::Num<plug::compile::tail_rec_elim_pass> = 0;
304
305template<> struct Axm::IsANode<plug::compile::Phase> { using type = Axm; };
306template<> struct Axm::IsANode<plug::compile::Pass> { using type = Axm; };
307template<> struct Axm::IsANode<plug::compile::Repl> { using type = Axm; };
308template<> struct Axm::IsANode<plug::compile::beta_red_phase> { using type = Axm; };
309template<> struct Axm::IsANode<plug::compile::branch_normalize_phase> { using type = Axm; };
310template<> struct Axm::IsANode<plug::compile::cleanup_phase> { using type = Axm; };
311template<> struct Axm::IsANode<plug::compile::eta_exp_phase> { using type = Axm; };
312template<> struct Axm::IsANode<plug::compile::eta_red_phase> { using type = Axm; };
313template<> struct Axm::IsANode<plug::compile::null_phase> { using type = Axm; };
314template<> struct Axm::IsANode<plug::compile::ret_wrap_phase> { using type = Axm; };
315template<> struct Axm::IsANode<plug::compile::sym_expr_opt> { using type = Axm; };
316template<> struct Axm::IsANode<plug::compile::internal_cleanup_phase> { using type = Axm; };
317template<> struct Axm::IsANode<plug::compile::null_repl> { using type = Axm; };
318template<> struct Axm::IsANode<plug::compile::beta_red_pass> { using type = Axm; };
319template<> struct Axm::IsANode<plug::compile::eta_exp_pass> { using type = Axm; };
320template<> struct Axm::IsANode<plug::compile::lam_spec_pass> { using type = Axm; };
321template<> struct Axm::IsANode<plug::compile::null_pass> { using type = Axm; };
322template<> struct Axm::IsANode<plug::compile::scalarize_pass> { using type = Axm; };
323template<> struct Axm::IsANode<plug::compile::tail_rec_elim_pass> { using type = Axm; };
324
325#endif
326} // namespace mim
327
328#ifndef DOXYGEN // don't include in Doxygen documentation
329
330
331#endif
Base class for all Defs.
Definition def.h:246
The compile Plugin
const Def * normalize_cond_phase(const Def *, const Def *callee, const Def *phase)
compile.cond_phase name phase ↦ phase if name's plugin is loaded, else compile.null_phase.
void register_normalizers(Normalizers &normalizers)
const Def * normalize_is_loaded(const Def *, const Def *, const Def *arg)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
Definition ast.h:14
u64 flags_t
Definition types.h:39
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:22
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:109
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:147
static constexpr flags_t Base
Definition plugin.h:148