Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <thorin/axiom.h>
4#include <thorin/plugin.h>
5
6/// @namespace thorin::plug::compile @ref compile
7namespace thorin {
8namespace plug::compile {
9
10static constexpr plugin_t Plugin_Id = 0x11039128d1800000;
11
12/// @name %%compile.Pass
13///@{
14#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
15enum Pass : flags_t {
16#else
17enum class Pass : flags_t {
18#endif
19};
20
21///@}
22
23/// @name %%compile.Phase
24///@{
25#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
26enum Phase : flags_t {
27#else
28enum class Phase : flags_t {
29#endif
30};
31
32///@}
33
34/// @name %%compile.Pipeline
35///@{
36#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
38#else
39enum class Pipeline : flags_t {
40#endif
41};
42
43///@}
44
45/// @name %%compile.PassList
46///@{
47#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
49#else
50enum class PassList : flags_t {
51#endif
52};
53
54///@}
55
56/// @name %%compile.CombinedPhase
57///@{
58#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
60#else
61enum class CombinedPhase : flags_t {
62#endif
63};
64
65///@}
66
67/// @name %%compile.Plugin
68///@{
69#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
71#else
72enum class Plugin : flags_t {
73#endif
74};
75
76///@}
77
78/// @name %%compile.core_plugin
79///@{
80#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
82#else
83enum class core_plugin : flags_t {
84#endif
85};
86
87///@}
88
89/// @name %%compile.mem_plugin
90///@{
91#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
93#else
94enum class mem_plugin : flags_t {
95#endif
96};
97
98///@}
99
100/// @name %%compile.demo_plugin
101///@{
102#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
104#else
105enum class demo_plugin : flags_t {
106#endif
107};
108
109///@}
110
111/// @name %%compile.affine_plugin
112///@{
113#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
115#else
116enum class affine_plugin : flags_t {
117#endif
118};
119
120///@}
121
122/// @name %%compile.autodiff_plugin
123///@{
124#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
126#else
127enum class autodiff_plugin : flags_t {
128#endif
129};
130
131///@}
132
133/// @name %%compile.clos_plugin
134///@{
135#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
137#else
138enum class clos_plugin : flags_t {
139#endif
140};
141
142///@}
143
144/// @name %%compile.direct_plugin
145///@{
146#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
148#else
149enum class direct_plugin : flags_t {
150#endif
151};
152
153///@}
154
155/// @name %%compile.refly_plugin
156///@{
157#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
159#else
160enum class refly_plugin : flags_t {
161#endif
162};
163
164///@}
165
166/// @name %%compile.regex_plugin
167///@{
168#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
170#else
171enum class regex_plugin : flags_t {
172#endif
173};
174
175///@}
176
177/// @name %%compile.matrix_plugin
178///@{
179#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
181#else
182enum class matrix_plugin : flags_t {
183#endif
184};
185
186///@}
187
188/// @name %%compile.pipe
189///@{
190#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
191enum pipe : flags_t {
192#else
193enum class pipe : flags_t {
194#endif
195};
196
197///@}
198
199/// @name %%compile.debug_phase
200///@{
201#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
203#else
204enum class debug_phase : flags_t {
205#endif
206};
207
208///@}
209
210/// @name %%compile.pass_list
211///@{
212#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
214#else
215enum class pass_list : flags_t {
216#endif
217};
218
219///@}
220
221/// @name %%compile.pass_phase
222///@{
223#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
225#else
226enum class pass_phase : flags_t {
227#endif
228};
229
231///@}
232
233/// @name %%compile.passes_to_phase
234///@{
235#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
237#else
238enum class passes_to_phase : flags_t {
239#endif
240};
241
242///@}
243
244/// @name %%compile.combine_pass_list
245///@{
246#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
248#else
249enum class combine_pass_list : flags_t {
250#endif
251};
252
254///@}
255
256/// @name %%compile.single_pass_phase
257///@{
258#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
260#else
261enum class single_pass_phase : flags_t {
262#endif
263};
264
266///@}
267
268/// @name %%compile.phase_list
269///@{
270#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
272#else
273enum class phase_list : flags_t {
274#endif
275};
276
277///@}
278
279/// @name %%compile.combined_phase
280///@{
281#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
283#else
284enum class combined_phase : flags_t {
285#endif
286};
287
289///@}
290
291/// @name %%compile.phases_to_phase
292///@{
293#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
295#else
296enum class phases_to_phase : flags_t {
297#endif
298};
299
300///@}
301
302/// @name %%compile.beta_red_pass
303///@{
304#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
306#else
307enum class beta_red_pass : flags_t {
308#endif
309};
310
311///@}
312
313/// @name %%compile.eta_red_pass
314///@{
315#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
317#else
318enum class eta_red_pass : flags_t {
319#endif
320};
321
322///@}
323
324/// @name %%compile.eta_exp_pass
325///@{
326#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
328#else
329enum class eta_exp_pass : flags_t {
330#endif
331};
332
333///@}
334
335/// @name %%compile.scalerize_pass
336///@{
337#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
339#else
340enum class scalerize_pass : flags_t {
341#endif
342};
343
344///@}
345
346/// @name %%compile.tail_rec_elim_pass
347///@{
348#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
350#else
351enum class tail_rec_elim_pass : flags_t {
352#endif
353};
354
355///@}
356
357/// @name %%compile.lam_spec_pass
358///@{
359#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
361#else
362enum class lam_spec_pass : flags_t {
363#endif
364};
365
366///@}
367
368/// @name %%compile.ret_wrap_pass
369///@{
370#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
372#else
373enum class ret_wrap_pass : flags_t {
374#endif
375};
376
377///@}
378
379/// @name %%compile.nullptr_pass
380///@{
381#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
383#else
384enum class nullptr_pass : flags_t {
385#endif
386};
387
388///@}
389
390/// @name %%compile.internal_cleanup_pass
391///@{
392#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
394#else
395enum class internal_cleanup_pass : flags_t {
396#endif
397};
398
399///@}
400
401/// @name %%compile.plugin_select
402///@{
403#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
405#else
406enum class plugin_select : flags_t {
407#endif
408};
409
410///@}
411
413
414#define THORIN_compile_NORMALIZER_IMPL \
415 void register_normalizers(Normalizers& normalizers) {\
416 normalizers[flags_t(Annex::Base<pass_phase>)] = &normalize_pass_phase; \
417 normalizers[flags_t(Annex::Base<combine_pass_list>)] = &normalize_combine_pass_list; \
418 normalizers[flags_t(Annex::Base<single_pass_phase>)] = &normalize_single_pass_phase; \
419 normalizers[flags_t(Annex::Base<combined_phase>)] = &normalize_combined_phase; \
420 }
421} // namespace plug::compile
422
423#ifndef DOXYGEN // don't include in Doxygen documentation
424template<> constexpr flags_t Annex::Base<plug::compile::Pass> = 0x11039128d1800000;
425template<> constexpr size_t Annex::Num<plug::compile::Pass> = 0;
426template<> constexpr flags_t Annex::Base<plug::compile::Phase> = 0x11039128d1800100;
427template<> constexpr size_t Annex::Num<plug::compile::Phase> = 0;
428template<> constexpr flags_t Annex::Base<plug::compile::Pipeline> = 0x11039128d1800200;
429template<> constexpr size_t Annex::Num<plug::compile::Pipeline> = 0;
430template<> constexpr flags_t Annex::Base<plug::compile::PassList> = 0x11039128d1800300;
431template<> constexpr size_t Annex::Num<plug::compile::PassList> = 0;
432template<> constexpr flags_t Annex::Base<plug::compile::CombinedPhase> = 0x11039128d1800400;
433template<> constexpr size_t Annex::Num<plug::compile::CombinedPhase> = 0;
434template<> constexpr flags_t Annex::Base<plug::compile::Plugin> = 0x11039128d1800500;
435template<> constexpr size_t Annex::Num<plug::compile::Plugin> = 0;
436template<> constexpr flags_t Annex::Base<plug::compile::core_plugin> = 0x11039128d1800600;
437template<> constexpr size_t Annex::Num<plug::compile::core_plugin> = 0;
438template<> constexpr flags_t Annex::Base<plug::compile::mem_plugin> = 0x11039128d1800700;
439template<> constexpr size_t Annex::Num<plug::compile::mem_plugin> = 0;
440template<> constexpr flags_t Annex::Base<plug::compile::demo_plugin> = 0x11039128d1800800;
441template<> constexpr size_t Annex::Num<plug::compile::demo_plugin> = 0;
442template<> constexpr flags_t Annex::Base<plug::compile::affine_plugin> = 0x11039128d1800900;
443template<> constexpr size_t Annex::Num<plug::compile::affine_plugin> = 0;
444template<> constexpr flags_t Annex::Base<plug::compile::autodiff_plugin> = 0x11039128d1800a00;
445template<> constexpr size_t Annex::Num<plug::compile::autodiff_plugin> = 0;
446template<> constexpr flags_t Annex::Base<plug::compile::clos_plugin> = 0x11039128d1800b00;
447template<> constexpr size_t Annex::Num<plug::compile::clos_plugin> = 0;
448template<> constexpr flags_t Annex::Base<plug::compile::direct_plugin> = 0x11039128d1800c00;
449template<> constexpr size_t Annex::Num<plug::compile::direct_plugin> = 0;
450template<> constexpr flags_t Annex::Base<plug::compile::refly_plugin> = 0x11039128d1800d00;
451template<> constexpr size_t Annex::Num<plug::compile::refly_plugin> = 0;
452template<> constexpr flags_t Annex::Base<plug::compile::regex_plugin> = 0x11039128d1800e00;
453template<> constexpr size_t Annex::Num<plug::compile::regex_plugin> = 0;
454template<> constexpr flags_t Annex::Base<plug::compile::matrix_plugin> = 0x11039128d1800f00;
455template<> constexpr size_t Annex::Num<plug::compile::matrix_plugin> = 0;
456template<> constexpr flags_t Annex::Base<plug::compile::pipe> = 0x11039128d1801000;
457template<> constexpr size_t Annex::Num<plug::compile::pipe> = 0;
458template<> constexpr flags_t Annex::Base<plug::compile::debug_phase> = 0x11039128d1801100;
459template<> constexpr size_t Annex::Num<plug::compile::debug_phase> = 0;
460template<> constexpr flags_t Annex::Base<plug::compile::pass_list> = 0x11039128d1801200;
461template<> constexpr size_t Annex::Num<plug::compile::pass_list> = 0;
462template<> constexpr flags_t Annex::Base<plug::compile::pass_phase> = 0x11039128d1801300;
463template<> constexpr size_t Annex::Num<plug::compile::pass_phase> = 0;
464template<> constexpr flags_t Annex::Base<plug::compile::passes_to_phase> = 0x11039128d1801400;
465template<> constexpr size_t Annex::Num<plug::compile::passes_to_phase> = 0;
466template<> constexpr flags_t Annex::Base<plug::compile::combine_pass_list> = 0x11039128d1801500;
467template<> constexpr size_t Annex::Num<plug::compile::combine_pass_list> = 0;
468template<> constexpr flags_t Annex::Base<plug::compile::single_pass_phase> = 0x11039128d1801600;
469template<> constexpr size_t Annex::Num<plug::compile::single_pass_phase> = 0;
470template<> constexpr flags_t Annex::Base<plug::compile::phase_list> = 0x11039128d1801700;
471template<> constexpr size_t Annex::Num<plug::compile::phase_list> = 0;
472template<> constexpr flags_t Annex::Base<plug::compile::combined_phase> = 0x11039128d1801800;
473template<> constexpr size_t Annex::Num<plug::compile::combined_phase> = 0;
474template<> constexpr flags_t Annex::Base<plug::compile::phases_to_phase> = 0x11039128d1801900;
475template<> constexpr size_t Annex::Num<plug::compile::phases_to_phase> = 0;
476template<> constexpr flags_t Annex::Base<plug::compile::beta_red_pass> = 0x11039128d1801a00;
477template<> constexpr size_t Annex::Num<plug::compile::beta_red_pass> = 0;
478template<> constexpr flags_t Annex::Base<plug::compile::eta_red_pass> = 0x11039128d1801b00;
479template<> constexpr size_t Annex::Num<plug::compile::eta_red_pass> = 0;
480template<> constexpr flags_t Annex::Base<plug::compile::eta_exp_pass> = 0x11039128d1801c00;
481template<> constexpr size_t Annex::Num<plug::compile::eta_exp_pass> = 0;
482template<> constexpr flags_t Annex::Base<plug::compile::scalerize_pass> = 0x11039128d1801d00;
483template<> constexpr size_t Annex::Num<plug::compile::scalerize_pass> = 0;
484template<> constexpr flags_t Annex::Base<plug::compile::tail_rec_elim_pass> = 0x11039128d1801e00;
485template<> constexpr size_t Annex::Num<plug::compile::tail_rec_elim_pass> = 0;
486template<> constexpr flags_t Annex::Base<plug::compile::lam_spec_pass> = 0x11039128d1801f00;
487template<> constexpr size_t Annex::Num<plug::compile::lam_spec_pass> = 0;
488template<> constexpr flags_t Annex::Base<plug::compile::ret_wrap_pass> = 0x11039128d1802000;
489template<> constexpr size_t Annex::Num<plug::compile::ret_wrap_pass> = 0;
490template<> constexpr flags_t Annex::Base<plug::compile::nullptr_pass> = 0x11039128d1802100;
491template<> constexpr size_t Annex::Num<plug::compile::nullptr_pass> = 0;
492template<> constexpr flags_t Annex::Base<plug::compile::internal_cleanup_pass> = 0x11039128d1802200;
493template<> constexpr size_t Annex::Num<plug::compile::internal_cleanup_pass> = 0;
494template<> constexpr flags_t Annex::Base<plug::compile::plugin_select> = 0x11039128d1802300;
495template<> constexpr size_t Annex::Num<plug::compile::plugin_select> = 0;
496
497template<> struct Axiom::Match<plug::compile::Pass> { using type = Axiom; };
498template<> struct Axiom::Match<plug::compile::Phase> { using type = Axiom; };
499template<> struct Axiom::Match<plug::compile::Pipeline> { using type = Axiom; };
500template<> struct Axiom::Match<plug::compile::PassList> { using type = Axiom; };
501template<> struct Axiom::Match<plug::compile::CombinedPhase> { using type = Axiom; };
502template<> struct Axiom::Match<plug::compile::Plugin> { using type = Axiom; };
503template<> struct Axiom::Match<plug::compile::core_plugin> { using type = Axiom; };
504template<> struct Axiom::Match<plug::compile::mem_plugin> { using type = Axiom; };
505template<> struct Axiom::Match<plug::compile::demo_plugin> { using type = Axiom; };
506template<> struct Axiom::Match<plug::compile::affine_plugin> { using type = Axiom; };
507template<> struct Axiom::Match<plug::compile::autodiff_plugin> { using type = Axiom; };
508template<> struct Axiom::Match<plug::compile::clos_plugin> { using type = Axiom; };
509template<> struct Axiom::Match<plug::compile::direct_plugin> { using type = Axiom; };
510template<> struct Axiom::Match<plug::compile::refly_plugin> { using type = Axiom; };
511template<> struct Axiom::Match<plug::compile::regex_plugin> { using type = Axiom; };
512template<> struct Axiom::Match<plug::compile::matrix_plugin> { using type = Axiom; };
513template<> struct Axiom::Match<plug::compile::beta_red_pass> { using type = Axiom; };
514template<> struct Axiom::Match<plug::compile::eta_red_pass> { using type = Axiom; };
515template<> struct Axiom::Match<plug::compile::lam_spec_pass> { using type = Axiom; };
516template<> struct Axiom::Match<plug::compile::ret_wrap_pass> { using type = Axiom; };
517template<> struct Axiom::Match<plug::compile::nullptr_pass> { using type = Axiom; };
518template<> struct Axiom::Match<plug::compile::internal_cleanup_pass> { using type = Axiom; };
519#endif
520} // namespace thorin
Helper class to retrieve Infer::arg if present.
Definition def.h:85
@ Axiom
Definition def.h:39
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
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...
Ref normalize_combined_phase(Ref type, Ref, Ref arg)
combined_phase (phase_list phase1 ... phasen) -> phases_to_phase n (phase1, ..., phasen)
void register_normalizers(Normalizers &normalizers)
Ref normalize_pass_phase(Ref type, Ref, Ref arg)
Ref normalize_single_pass_phase(Ref type, Ref, Ref arg)
single_pass_phase pass -> passes_to_phase 1 pass
Definition cfg.h:11
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:47
u64 flags_t
Definition types.h:46
static constexpr flags_t Base
Definition plugin.h:121