MimIR 0.1
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/axiom.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.Pass
13///@{
14enum class Pass : flags_t {
15};
16
17///@}
18
19/// @name %%compile.Phase
20///@{
21enum class Phase : flags_t {
22};
23
24///@}
25
26/// @name %%compile.Pipeline
27///@{
28enum class Pipeline : flags_t {
29};
30
31///@}
32
33/// @name %%compile.PassList
34///@{
35enum class PassList : flags_t {
36};
37
38///@}
39
40/// @name %%compile.CombinedPhase
41///@{
42enum class CombinedPhase : flags_t {
43};
44
45///@}
46
47/// @name %%compile.Plugin
48///@{
49enum class Plugin : flags_t {
50};
51
52///@}
53
54/// @name %%compile.core_plugin
55///@{
56enum class core_plugin : flags_t {
57};
58
59///@}
60
61/// @name %%compile.mem_plugin
62///@{
63enum class mem_plugin : flags_t {
64};
65
66///@}
67
68/// @name %%compile.demo_plugin
69///@{
70enum class demo_plugin : flags_t {
71};
72
73///@}
74
75/// @name %%compile.affine_plugin
76///@{
77enum class affine_plugin : flags_t {
78};
79
80///@}
81
82/// @name %%compile.autodiff_plugin
83///@{
85};
86
87///@}
88
89/// @name %%compile.clos_plugin
90///@{
91enum class clos_plugin : flags_t {
92};
93
94///@}
95
96/// @name %%compile.direct_plugin
97///@{
98enum class direct_plugin : flags_t {
99};
100
101///@}
102
103/// @name %%compile.refly_plugin
104///@{
105enum class refly_plugin : flags_t {
106};
107
108///@}
109
110/// @name %%compile.regex_plugin
111///@{
112enum class regex_plugin : flags_t {
113};
114
115///@}
116
117/// @name %%compile.matrix_plugin
118///@{
119enum class matrix_plugin : flags_t {
120};
121
122///@}
123
124/// @name %%compile.pipe
125///@{
126enum class pipe : flags_t {
127};
128
129///@}
130
131/// @name %%compile.debug_phase
132///@{
133enum class debug_phase : flags_t {
134};
135
136///@}
137
138/// @name %%compile.pass_list
139///@{
140enum class pass_list : flags_t {
141};
142
143///@}
144
145/// @name %%compile.pass_phase
146///@{
147enum class pass_phase : flags_t {
148};
149
151///@}
152
153/// @name %%compile.passes_to_phase
154///@{
156};
157
158///@}
159
160/// @name %%compile.combine_pass_list
161///@{
163};
164
166///@}
167
168/// @name %%compile.single_pass_phase
169///@{
171};
172
174///@}
175
176/// @name %%compile.phase_list
177///@{
178enum class phase_list : flags_t {
179};
180
181///@}
182
183/// @name %%compile.combined_phase
184///@{
186};
187
189///@}
190
191/// @name %%compile.phases_to_phase
192///@{
194};
195
196///@}
197
198/// @name %%compile.beta_red_pass
199///@{
200enum class beta_red_pass : flags_t {
201};
202
203///@}
204
205/// @name %%compile.eta_red_pass
206///@{
207enum class eta_red_pass : flags_t {
208};
209
210///@}
211
212/// @name %%compile.eta_exp_pass
213///@{
214enum class eta_exp_pass : flags_t {
215};
216
217///@}
218
219/// @name %%compile.scalarize_pass
220///@{
222};
223
224///@}
225
226/// @name %%compile.tail_rec_elim_pass
227///@{
229};
230
231///@}
232
233/// @name %%compile.lam_spec_pass
234///@{
235enum class lam_spec_pass : flags_t {
236};
237
238///@}
239
240/// @name %%compile.ret_wrap_pass
241///@{
242enum class ret_wrap_pass : flags_t {
243};
244
245///@}
246
247/// @name %%compile.nullptr_pass
248///@{
249enum class nullptr_pass : flags_t {
250};
251
252///@}
253
254/// @name %%compile.internal_cleanup_pass
255///@{
257};
258
259///@}
260
261/// @name %%compile.plugin_select
262///@{
263enum class plugin_select : flags_t {
264};
265
266///@}
267
269
270#define MIM_compile_NORMALIZER_IMPL \
271 void register_normalizers(Normalizers& normalizers) {\
272 normalizers[flags_t(Annex::Base<pass_phase>)] = &normalize_pass_phase; \
273 normalizers[flags_t(Annex::Base<combine_pass_list>)] = &normalize_combine_pass_list; \
274 normalizers[flags_t(Annex::Base<single_pass_phase>)] = &normalize_single_pass_phase; \
275 normalizers[flags_t(Annex::Base<combined_phase>)] = &normalize_combined_phase; \
276 }
277} // namespace plug::compile
278
279#ifndef DOXYGEN // don't include in Doxygen documentation
280
281template<> constexpr flags_t Annex::Base<plug::compile::Pass> = 0x11039128d1800000;
282template<> constexpr size_t Annex::Num<plug::compile::Pass> = 0;
283template<> constexpr flags_t Annex::Base<plug::compile::Phase> = 0x11039128d1800100;
284template<> constexpr size_t Annex::Num<plug::compile::Phase> = 0;
285template<> constexpr flags_t Annex::Base<plug::compile::Pipeline> = 0x11039128d1800200;
286template<> constexpr size_t Annex::Num<plug::compile::Pipeline> = 0;
287template<> constexpr flags_t Annex::Base<plug::compile::PassList> = 0x11039128d1800300;
288template<> constexpr size_t Annex::Num<plug::compile::PassList> = 0;
289template<> constexpr flags_t Annex::Base<plug::compile::CombinedPhase> = 0x11039128d1800400;
290template<> constexpr size_t Annex::Num<plug::compile::CombinedPhase> = 0;
291template<> constexpr flags_t Annex::Base<plug::compile::Plugin> = 0x11039128d1800500;
292template<> constexpr size_t Annex::Num<plug::compile::Plugin> = 0;
293template<> constexpr flags_t Annex::Base<plug::compile::core_plugin> = 0x11039128d1800600;
294template<> constexpr size_t Annex::Num<plug::compile::core_plugin> = 0;
295template<> constexpr flags_t Annex::Base<plug::compile::mem_plugin> = 0x11039128d1800700;
296template<> constexpr size_t Annex::Num<plug::compile::mem_plugin> = 0;
297template<> constexpr flags_t Annex::Base<plug::compile::demo_plugin> = 0x11039128d1800800;
298template<> constexpr size_t Annex::Num<plug::compile::demo_plugin> = 0;
299template<> constexpr flags_t Annex::Base<plug::compile::affine_plugin> = 0x11039128d1800900;
300template<> constexpr size_t Annex::Num<plug::compile::affine_plugin> = 0;
301template<> constexpr flags_t Annex::Base<plug::compile::autodiff_plugin> = 0x11039128d1800a00;
302template<> constexpr size_t Annex::Num<plug::compile::autodiff_plugin> = 0;
303template<> constexpr flags_t Annex::Base<plug::compile::clos_plugin> = 0x11039128d1800b00;
304template<> constexpr size_t Annex::Num<plug::compile::clos_plugin> = 0;
305template<> constexpr flags_t Annex::Base<plug::compile::direct_plugin> = 0x11039128d1800c00;
306template<> constexpr size_t Annex::Num<plug::compile::direct_plugin> = 0;
307template<> constexpr flags_t Annex::Base<plug::compile::refly_plugin> = 0x11039128d1800d00;
308template<> constexpr size_t Annex::Num<plug::compile::refly_plugin> = 0;
309template<> constexpr flags_t Annex::Base<plug::compile::regex_plugin> = 0x11039128d1800e00;
310template<> constexpr size_t Annex::Num<plug::compile::regex_plugin> = 0;
311template<> constexpr flags_t Annex::Base<plug::compile::matrix_plugin> = 0x11039128d1800f00;
312template<> constexpr size_t Annex::Num<plug::compile::matrix_plugin> = 0;
313template<> constexpr flags_t Annex::Base<plug::compile::pipe> = 0x11039128d1801000;
314template<> constexpr size_t Annex::Num<plug::compile::pipe> = 0;
315template<> constexpr flags_t Annex::Base<plug::compile::debug_phase> = 0x11039128d1801100;
316template<> constexpr size_t Annex::Num<plug::compile::debug_phase> = 0;
317template<> constexpr flags_t Annex::Base<plug::compile::pass_list> = 0x11039128d1801200;
318template<> constexpr size_t Annex::Num<plug::compile::pass_list> = 0;
319template<> constexpr flags_t Annex::Base<plug::compile::pass_phase> = 0x11039128d1801300;
320template<> constexpr size_t Annex::Num<plug::compile::pass_phase> = 0;
321template<> constexpr flags_t Annex::Base<plug::compile::passes_to_phase> = 0x11039128d1801400;
322template<> constexpr size_t Annex::Num<plug::compile::passes_to_phase> = 0;
323template<> constexpr flags_t Annex::Base<plug::compile::combine_pass_list> = 0x11039128d1801500;
324template<> constexpr size_t Annex::Num<plug::compile::combine_pass_list> = 0;
325template<> constexpr flags_t Annex::Base<plug::compile::single_pass_phase> = 0x11039128d1801600;
326template<> constexpr size_t Annex::Num<plug::compile::single_pass_phase> = 0;
327template<> constexpr flags_t Annex::Base<plug::compile::phase_list> = 0x11039128d1801700;
328template<> constexpr size_t Annex::Num<plug::compile::phase_list> = 0;
329template<> constexpr flags_t Annex::Base<plug::compile::combined_phase> = 0x11039128d1801800;
330template<> constexpr size_t Annex::Num<plug::compile::combined_phase> = 0;
331template<> constexpr flags_t Annex::Base<plug::compile::phases_to_phase> = 0x11039128d1801900;
332template<> constexpr size_t Annex::Num<plug::compile::phases_to_phase> = 0;
333template<> constexpr flags_t Annex::Base<plug::compile::beta_red_pass> = 0x11039128d1801a00;
334template<> constexpr size_t Annex::Num<plug::compile::beta_red_pass> = 0;
335template<> constexpr flags_t Annex::Base<plug::compile::eta_red_pass> = 0x11039128d1801b00;
336template<> constexpr size_t Annex::Num<plug::compile::eta_red_pass> = 0;
337template<> constexpr flags_t Annex::Base<plug::compile::eta_exp_pass> = 0x11039128d1801c00;
338template<> constexpr size_t Annex::Num<plug::compile::eta_exp_pass> = 0;
339template<> constexpr flags_t Annex::Base<plug::compile::scalarize_pass> = 0x11039128d1801d00;
340template<> constexpr size_t Annex::Num<plug::compile::scalarize_pass> = 0;
341template<> constexpr flags_t Annex::Base<plug::compile::tail_rec_elim_pass> = 0x11039128d1801e00;
342template<> constexpr size_t Annex::Num<plug::compile::tail_rec_elim_pass> = 0;
343template<> constexpr flags_t Annex::Base<plug::compile::lam_spec_pass> = 0x11039128d1801f00;
344template<> constexpr size_t Annex::Num<plug::compile::lam_spec_pass> = 0;
345template<> constexpr flags_t Annex::Base<plug::compile::ret_wrap_pass> = 0x11039128d1802000;
346template<> constexpr size_t Annex::Num<plug::compile::ret_wrap_pass> = 0;
347template<> constexpr flags_t Annex::Base<plug::compile::nullptr_pass> = 0x11039128d1802100;
348template<> constexpr size_t Annex::Num<plug::compile::nullptr_pass> = 0;
349template<> constexpr flags_t Annex::Base<plug::compile::internal_cleanup_pass> = 0x11039128d1802200;
350template<> constexpr size_t Annex::Num<plug::compile::internal_cleanup_pass> = 0;
351template<> constexpr flags_t Annex::Base<plug::compile::plugin_select> = 0x11039128d1802300;
352template<> constexpr size_t Annex::Num<plug::compile::plugin_select> = 0;
353
354template<> struct Axiom::Match<plug::compile::Pass> { using type = Axiom; };
355template<> struct Axiom::Match<plug::compile::Phase> { using type = Axiom; };
356template<> struct Axiom::Match<plug::compile::Pipeline> { using type = Axiom; };
357template<> struct Axiom::Match<plug::compile::PassList> { using type = Axiom; };
358template<> struct Axiom::Match<plug::compile::CombinedPhase> { using type = Axiom; };
359template<> struct Axiom::Match<plug::compile::Plugin> { using type = Axiom; };
360template<> struct Axiom::Match<plug::compile::core_plugin> { using type = Axiom; };
361template<> struct Axiom::Match<plug::compile::mem_plugin> { using type = Axiom; };
362template<> struct Axiom::Match<plug::compile::demo_plugin> { using type = Axiom; };
363template<> struct Axiom::Match<plug::compile::affine_plugin> { using type = Axiom; };
364template<> struct Axiom::Match<plug::compile::autodiff_plugin> { using type = Axiom; };
365template<> struct Axiom::Match<plug::compile::clos_plugin> { using type = Axiom; };
366template<> struct Axiom::Match<plug::compile::direct_plugin> { using type = Axiom; };
367template<> struct Axiom::Match<plug::compile::refly_plugin> { using type = Axiom; };
368template<> struct Axiom::Match<plug::compile::regex_plugin> { using type = Axiom; };
369template<> struct Axiom::Match<plug::compile::matrix_plugin> { using type = Axiom; };
370template<> struct Axiom::Match<plug::compile::beta_red_pass> { using type = Axiom; };
371template<> struct Axiom::Match<plug::compile::eta_red_pass> { using type = Axiom; };
372template<> struct Axiom::Match<plug::compile::lam_spec_pass> { using type = Axiom; };
373template<> struct Axiom::Match<plug::compile::ret_wrap_pass> { using type = Axiom; };
374template<> struct Axiom::Match<plug::compile::nullptr_pass> { using type = Axiom; };
375template<> struct Axiom::Match<plug::compile::internal_cleanup_pass> { using type = Axiom; };
376
377#endif
378} // namespace mim
379
380#ifndef DOXYGEN // don't include in Doxygen documentation
381
382
383#endif
Helper class to retrieve Infer::arg if present.
Definition def.h:86
Ref normalize_combined_phase(Ref type, Ref, Ref arg)
combined_phase (phase_list phase1 ... phasen) -> phases_to_phase n (phase1, ..., phasen)
Ref normalize_pass_phase(Ref type, Ref, Ref arg)
void register_normalizers(Normalizers &normalizers)
Ref normalize_single_pass_phase(Ref type, Ref, Ref arg)
single_pass_phase pass -> passes_to_phase 1 pass
Ref normalize_combine_pass_list(Ref type, Ref, Ref arg)
combine_pass_list K (pass_list pass11 ... pass1N) ... (pass_list passK1 ... passKM) = pass_list pass1...
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
Definition cfg.h:11
u64 flags_t
Definition types.h:45
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:46
static constexpr size_t Num
Definition plugin.h:115
static constexpr flags_t Base
Definition plugin.h:118