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.aggr`
20///@{
21enum class aggr : flags_t {
22};
23
24const Def* normalize_aggr(const Def*, const Def*, const Def*);
25///@}
26
27/// @name `compile.cond`
28///@{
29enum class cond : flags_t {
30};
31
32const Def* normalize_cond(const Def*, const Def*, const Def*);
33///@}
34
35/// @name `compile.is_loaded`
36///@{
37enum class is_loaded : flags_t {
38};
39
40const Def* normalize_is_loaded(const Def*, const Def*, const Def*);
41///@}
42
43/// @name `compile.named`
44///@{
45enum class named : flags_t {
46};
47
48///@}
49
50/// @name `compile.phases`
51///@{
52enum class phases : flags_t {
53};
54
55///@}
56
57/// @name `compile.adce`
58///@{
59enum class adce : flags_t {
60};
61
62///@}
63
64/// @name `compile.beta_red`
65///@{
66enum class beta_red : flags_t {
67};
68
69///@}
70
71/// @name `compile.cleanup`
72///@{
73enum class cleanup : flags_t {
74};
75
76///@}
77
78/// @name `compile.dispatch_normalize`
79///@{
81};
82
83///@}
84
85/// @name `compile.eta_conv`
86///@{
87enum class eta_conv : flags_t {
88};
89
90///@}
91
92/// @name `compile.lam_spec`
93///@{
94enum class lam_spec : flags_t {
95};
96
97///@}
98
99/// @name `compile.nom_erasure`
100///@{
101enum class nom_erasure : flags_t {
102};
103
104///@}
105
106/// @name `compile.null`
107///@{
108enum class null : flags_t {
109};
110
111///@}
112
113/// @name `compile.ret_wrap`
114///@{
115enum class ret_wrap : flags_t {
116};
117
118///@}
119
120/// @name `compile.scalarize`
121///@{
122enum class scalarize : flags_t {
123};
124
125///@}
126
127/// @name `compile.sccp`
128///@{
129enum class sccp : flags_t {
130};
131
132///@}
133
134/// @name `compile.single_erasure`
135///@{
137};
138
139///@}
140
141/// @name `compile.static_arg_opt`
142///@{
144};
145
146///@}
147
149
150#define MIM_compile_NORMALIZER_IMPL \
151 void register_normalizers(Normalizers& normalizers) {\
152 normalizers[flags_t(Annex::Base<aggr>)] = &normalize_aggr; \
153 normalizers[flags_t(Annex::Base<cond>)] = &normalize_cond; \
154 normalizers[flags_t(Annex::Base<is_loaded>)] = &normalize_is_loaded; \
155 }
156} // namespace plug::compile
157
158#ifndef DOXYGEN // don't include in Doxygen documentation
159
160template<> constexpr flags_t Annex::Base<plug::compile::Phase> = 0x11039128d1800000;
161template<> constexpr size_t Annex::Num<plug::compile::Phase> = 0;
162template<> constexpr flags_t Annex::Base<plug::compile::aggr> = 0x11039128d1800100;
163template<> constexpr size_t Annex::Num<plug::compile::aggr> = 0;
164template<> constexpr flags_t Annex::Base<plug::compile::cond> = 0x11039128d1800200;
165template<> constexpr size_t Annex::Num<plug::compile::cond> = 0;
166template<> constexpr flags_t Annex::Base<plug::compile::is_loaded> = 0x11039128d1800300;
167template<> constexpr size_t Annex::Num<plug::compile::is_loaded> = 0;
168template<> constexpr flags_t Annex::Base<plug::compile::named> = 0x11039128d1800400;
169template<> constexpr size_t Annex::Num<plug::compile::named> = 0;
170template<> constexpr flags_t Annex::Base<plug::compile::phases> = 0x11039128d1800500;
171template<> constexpr size_t Annex::Num<plug::compile::phases> = 0;
172template<> constexpr flags_t Annex::Base<plug::compile::adce> = 0x11039128d1800600;
173template<> constexpr size_t Annex::Num<plug::compile::adce> = 0;
174template<> constexpr flags_t Annex::Base<plug::compile::beta_red> = 0x11039128d1800700;
175template<> constexpr size_t Annex::Num<plug::compile::beta_red> = 0;
176template<> constexpr flags_t Annex::Base<plug::compile::cleanup> = 0x11039128d1800800;
177template<> constexpr size_t Annex::Num<plug::compile::cleanup> = 0;
178template<> constexpr flags_t Annex::Base<plug::compile::dispatch_normalize> = 0x11039128d1800900;
179template<> constexpr size_t Annex::Num<plug::compile::dispatch_normalize> = 0;
180template<> constexpr flags_t Annex::Base<plug::compile::eta_conv> = 0x11039128d1800a00;
181template<> constexpr size_t Annex::Num<plug::compile::eta_conv> = 0;
182template<> constexpr flags_t Annex::Base<plug::compile::lam_spec> = 0x11039128d1800b00;
183template<> constexpr size_t Annex::Num<plug::compile::lam_spec> = 0;
184template<> constexpr flags_t Annex::Base<plug::compile::nom_erasure> = 0x11039128d1800c00;
185template<> constexpr size_t Annex::Num<plug::compile::nom_erasure> = 0;
186template<> constexpr flags_t Annex::Base<plug::compile::null> = 0x11039128d1800d00;
187template<> constexpr size_t Annex::Num<plug::compile::null> = 0;
188template<> constexpr flags_t Annex::Base<plug::compile::ret_wrap> = 0x11039128d1800e00;
189template<> constexpr size_t Annex::Num<plug::compile::ret_wrap> = 0;
190template<> constexpr flags_t Annex::Base<plug::compile::scalarize> = 0x11039128d1800f00;
191template<> constexpr size_t Annex::Num<plug::compile::scalarize> = 0;
192template<> constexpr flags_t Annex::Base<plug::compile::sccp> = 0x11039128d1801000;
193template<> constexpr size_t Annex::Num<plug::compile::sccp> = 0;
194template<> constexpr flags_t Annex::Base<plug::compile::single_erasure> = 0x11039128d1801100;
195template<> constexpr size_t Annex::Num<plug::compile::single_erasure> = 0;
196template<> constexpr flags_t Annex::Base<plug::compile::static_arg_opt> = 0x11039128d1801200;
197template<> constexpr size_t Annex::Num<plug::compile::static_arg_opt> = 0;
198
199template<> struct Axm::IsANode<plug::compile::Phase> { using type = Axm; };
200template<> struct Axm::IsANode<plug::compile::adce> { using type = Axm; };
201template<> struct Axm::IsANode<plug::compile::beta_red> { using type = Axm; };
202template<> struct Axm::IsANode<plug::compile::cleanup> { using type = Axm; };
203template<> struct Axm::IsANode<plug::compile::dispatch_normalize> { using type = Axm; };
204template<> struct Axm::IsANode<plug::compile::eta_conv> { using type = Axm; };
205template<> struct Axm::IsANode<plug::compile::lam_spec> { using type = Axm; };
206template<> struct Axm::IsANode<plug::compile::nom_erasure> { using type = Axm; };
207template<> struct Axm::IsANode<plug::compile::null> { using type = Axm; };
208template<> struct Axm::IsANode<plug::compile::ret_wrap> { using type = Axm; };
209template<> struct Axm::IsANode<plug::compile::scalarize> { using type = Axm; };
210template<> struct Axm::IsANode<plug::compile::sccp> { using type = Axm; };
211template<> struct Axm::IsANode<plug::compile::single_erasure> { using type = Axm; };
212template<> struct Axm::IsANode<plug::compile::static_arg_opt> { using type = Axm; };
213
214#endif
215} // namespace mim
216
217#ifndef DOXYGEN // don't include in Doxygen documentation
218
219
220#endif
Base class for all Defs.
Definition def.h:289
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/:no-aggr was passed, else fallback.
Definition ast.h:16
u64 flags_t
Definition types.h:39
ankerl::unordered_dense::map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:27
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:125
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:273
static constexpr flags_t Base
Definition plugin.h:274