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.is_loaded
20///@{
21enum class is_loaded : flags_t {
22};
23
24const Def* normalize_is_loaded(const Def*, const Def*, const Def*);
25///@}
26
27/// @name %%compile.named
28///@{
29enum class named : flags_t {
30};
31
32///@}
33
34/// @name %%compile.cond
35///@{
36enum class cond : flags_t {
37};
38
39const Def* normalize_cond(const Def*, const Def*, const Def*);
40///@}
41
42/// @name %%compile.aggr
43///@{
44enum class aggr : flags_t {
45};
46
47const Def* normalize_aggr(const Def*, const Def*, const Def*);
48///@}
49
50/// @name %%compile.phases
51///@{
52enum class phases : flags_t {
53};
54
55///@}
56
57/// @name %%compile.beta_red
58///@{
59enum class beta_red : flags_t {
60};
61
62///@}
63
64/// @name %%compile.branch_normalize
65///@{
67};
68
69///@}
70
71/// @name %%compile.cleanup
72///@{
73enum class cleanup : flags_t {
74};
75
76///@}
77
78/// @name %%compile.eta_conv
79///@{
80enum class eta_conv : flags_t {
81};
82
83///@}
84
85/// @name %%compile.lam_spec
86///@{
87enum class lam_spec : flags_t {
88};
89
90///@}
91
92/// @name %%compile.null
93///@{
94enum class null : flags_t {
95};
96
97///@}
98
99/// @name %%compile.ret_wrap
100///@{
101enum class ret_wrap : flags_t {
102};
103
104///@}
105
106/// @name %%compile.scalarize
107///@{
108enum class scalarize : flags_t {
109};
110
111///@}
112
113/// @name %%compile.tail_rec_elim
114///@{
115enum class tail_rec_elim : flags_t {
116};
117
118///@}
119
120/// @name %%compile.prefix_cleanup
121///@{
123};
124
125///@}
126
127/// @name %%compile.internal_cleanup
128///@{
130};
131
132///@}
133
135
136#define MIM_compile_NORMALIZER_IMPL \
137 void register_normalizers(Normalizers& normalizers) {\
138 normalizers[flags_t(Annex::Base<is_loaded>)] = &normalize_is_loaded; \
139 normalizers[flags_t(Annex::Base<cond>)] = &normalize_cond; \
140 normalizers[flags_t(Annex::Base<aggr>)] = &normalize_aggr; \
141 }
142} // namespace plug::compile
143
144#ifndef DOXYGEN // don't include in Doxygen documentation
145
146template<> constexpr flags_t Annex::Base<plug::compile::Phase> = 0x11039128d1800000;
147template<> constexpr size_t Annex::Num<plug::compile::Phase> = 0;
148template<> constexpr flags_t Annex::Base<plug::compile::is_loaded> = 0x11039128d1800100;
149template<> constexpr size_t Annex::Num<plug::compile::is_loaded> = 0;
150template<> constexpr flags_t Annex::Base<plug::compile::named> = 0x11039128d1800200;
151template<> constexpr size_t Annex::Num<plug::compile::named> = 0;
152template<> constexpr flags_t Annex::Base<plug::compile::cond> = 0x11039128d1800300;
153template<> constexpr size_t Annex::Num<plug::compile::cond> = 0;
154template<> constexpr flags_t Annex::Base<plug::compile::aggr> = 0x11039128d1800400;
155template<> constexpr size_t Annex::Num<plug::compile::aggr> = 0;
156template<> constexpr flags_t Annex::Base<plug::compile::phases> = 0x11039128d1800500;
157template<> constexpr size_t Annex::Num<plug::compile::phases> = 0;
158template<> constexpr flags_t Annex::Base<plug::compile::beta_red> = 0x11039128d1800600;
159template<> constexpr size_t Annex::Num<plug::compile::beta_red> = 0;
160template<> constexpr flags_t Annex::Base<plug::compile::branch_normalize> = 0x11039128d1800700;
161template<> constexpr size_t Annex::Num<plug::compile::branch_normalize> = 0;
162template<> constexpr flags_t Annex::Base<plug::compile::cleanup> = 0x11039128d1800800;
163template<> constexpr size_t Annex::Num<plug::compile::cleanup> = 0;
164template<> constexpr flags_t Annex::Base<plug::compile::eta_conv> = 0x11039128d1800900;
165template<> constexpr size_t Annex::Num<plug::compile::eta_conv> = 0;
166template<> constexpr flags_t Annex::Base<plug::compile::lam_spec> = 0x11039128d1800a00;
167template<> constexpr size_t Annex::Num<plug::compile::lam_spec> = 0;
168template<> constexpr flags_t Annex::Base<plug::compile::null> = 0x11039128d1800b00;
169template<> constexpr size_t Annex::Num<plug::compile::null> = 0;
170template<> constexpr flags_t Annex::Base<plug::compile::ret_wrap> = 0x11039128d1800c00;
171template<> constexpr size_t Annex::Num<plug::compile::ret_wrap> = 0;
172template<> constexpr flags_t Annex::Base<plug::compile::scalarize> = 0x11039128d1800d00;
173template<> constexpr size_t Annex::Num<plug::compile::scalarize> = 0;
174template<> constexpr flags_t Annex::Base<plug::compile::tail_rec_elim> = 0x11039128d1800e00;
175template<> constexpr size_t Annex::Num<plug::compile::tail_rec_elim> = 0;
176template<> constexpr flags_t Annex::Base<plug::compile::prefix_cleanup> = 0x11039128d1800f00;
177template<> constexpr size_t Annex::Num<plug::compile::prefix_cleanup> = 0;
178template<> constexpr flags_t Annex::Base<plug::compile::internal_cleanup> = 0x11039128d1801000;
179template<> constexpr size_t Annex::Num<plug::compile::internal_cleanup> = 0;
180
181template<> struct Axm::IsANode<plug::compile::Phase> { using type = Axm; };
182template<> struct Axm::IsANode<plug::compile::beta_red> { using type = Axm; };
183template<> struct Axm::IsANode<plug::compile::branch_normalize> { using type = Axm; };
184template<> struct Axm::IsANode<plug::compile::cleanup> { using type = Axm; };
185template<> struct Axm::IsANode<plug::compile::eta_conv> { using type = Axm; };
186template<> struct Axm::IsANode<plug::compile::lam_spec> { using type = Axm; };
187template<> struct Axm::IsANode<plug::compile::null> { using type = Axm; };
188template<> struct Axm::IsANode<plug::compile::ret_wrap> { using type = Axm; };
189template<> struct Axm::IsANode<plug::compile::scalarize> { using type = Axm; };
190template<> struct Axm::IsANode<plug::compile::tail_rec_elim> { using type = Axm; };
191template<> struct Axm::IsANode<plug::compile::internal_cleanup> { using type = Axm; };
192
193#endif
194} // namespace mim
195
196#ifndef DOXYGEN // don't include in Doxygen documentation
197
198
199#endif
Base class for all Defs.
Definition def.h:261
The compile Plugin
const Def * normalize_cond(const Def *, const Def *callee, const Def *phase)
compile.cond name phase ↦ phase if name's plugin is loaded, else compile.null.
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
const Def * normalize_aggr(const Def *, const Def *, const Def *arg)
compile.aggr fallback ↦ tt/ff if -X compile:aggr=on/=off was passed, else fallback.
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