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.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.static_arg_opt
114///@{
116};
117
118///@}
119
120/// @name %%compile.unload
121///@{
122enum class unload : flags_t {
123};
124
125///@}
126
128
129#define MIM_compile_NORMALIZER_IMPL \
130 void register_normalizers(Normalizers& normalizers) {\
131 normalizers[flags_t(Annex::Base<aggr>)] = &normalize_aggr; \
132 normalizers[flags_t(Annex::Base<cond>)] = &normalize_cond; \
133 normalizers[flags_t(Annex::Base<is_loaded>)] = &normalize_is_loaded; \
134 }
135} // namespace plug::compile
136
137#ifndef DOXYGEN // don't include in Doxygen documentation
138
139template<> constexpr flags_t Annex::Base<plug::compile::Phase> = 0x11039128d1800000;
140template<> constexpr size_t Annex::Num<plug::compile::Phase> = 0;
141template<> constexpr flags_t Annex::Base<plug::compile::aggr> = 0x11039128d1800100;
142template<> constexpr size_t Annex::Num<plug::compile::aggr> = 0;
143template<> constexpr flags_t Annex::Base<plug::compile::cond> = 0x11039128d1800200;
144template<> constexpr size_t Annex::Num<plug::compile::cond> = 0;
145template<> constexpr flags_t Annex::Base<plug::compile::is_loaded> = 0x11039128d1800300;
146template<> constexpr size_t Annex::Num<plug::compile::is_loaded> = 0;
147template<> constexpr flags_t Annex::Base<plug::compile::named> = 0x11039128d1800400;
148template<> constexpr size_t Annex::Num<plug::compile::named> = 0;
149template<> constexpr flags_t Annex::Base<plug::compile::phases> = 0x11039128d1800500;
150template<> constexpr size_t Annex::Num<plug::compile::phases> = 0;
151template<> constexpr flags_t Annex::Base<plug::compile::beta_red> = 0x11039128d1800600;
152template<> constexpr size_t Annex::Num<plug::compile::beta_red> = 0;
153template<> constexpr flags_t Annex::Base<plug::compile::branch_normalize> = 0x11039128d1800700;
154template<> constexpr size_t Annex::Num<plug::compile::branch_normalize> = 0;
155template<> constexpr flags_t Annex::Base<plug::compile::cleanup> = 0x11039128d1800800;
156template<> constexpr size_t Annex::Num<plug::compile::cleanup> = 0;
157template<> constexpr flags_t Annex::Base<plug::compile::eta_conv> = 0x11039128d1800900;
158template<> constexpr size_t Annex::Num<plug::compile::eta_conv> = 0;
159template<> constexpr flags_t Annex::Base<plug::compile::lam_spec> = 0x11039128d1800a00;
160template<> constexpr size_t Annex::Num<plug::compile::lam_spec> = 0;
161template<> constexpr flags_t Annex::Base<plug::compile::null> = 0x11039128d1800b00;
162template<> constexpr size_t Annex::Num<plug::compile::null> = 0;
163template<> constexpr flags_t Annex::Base<plug::compile::ret_wrap> = 0x11039128d1800c00;
164template<> constexpr size_t Annex::Num<plug::compile::ret_wrap> = 0;
165template<> constexpr flags_t Annex::Base<plug::compile::scalarize> = 0x11039128d1800d00;
166template<> constexpr size_t Annex::Num<plug::compile::scalarize> = 0;
167template<> constexpr flags_t Annex::Base<plug::compile::static_arg_opt> = 0x11039128d1800e00;
168template<> constexpr size_t Annex::Num<plug::compile::static_arg_opt> = 0;
169template<> constexpr flags_t Annex::Base<plug::compile::unload> = 0x11039128d1800f00;
170template<> constexpr size_t Annex::Num<plug::compile::unload> = 0;
171
172template<> struct Axm::IsANode<plug::compile::Phase> { using type = Axm; };
173template<> struct Axm::IsANode<plug::compile::beta_red> { using type = Axm; };
174template<> struct Axm::IsANode<plug::compile::branch_normalize> { using type = Axm; };
175template<> struct Axm::IsANode<plug::compile::cleanup> { using type = Axm; };
176template<> struct Axm::IsANode<plug::compile::eta_conv> { using type = Axm; };
177template<> struct Axm::IsANode<plug::compile::lam_spec> { using type = Axm; };
178template<> struct Axm::IsANode<plug::compile::null> { using type = Axm; };
179template<> struct Axm::IsANode<plug::compile::ret_wrap> { using type = Axm; };
180template<> struct Axm::IsANode<plug::compile::scalarize> { using type = Axm; };
181template<> struct Axm::IsANode<plug::compile::static_arg_opt> { using type = Axm; };
182
183#endif
184} // namespace mim
185
186#ifndef DOXYGEN // don't include in Doxygen documentation
187
188
189#endif
Base class for all Defs.
Definition def.h:273
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
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:27
u64 plugin_t
Definition types.h:40
@ Axm
Definition def.h:122
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:247
static constexpr flags_t Base
Definition plugin.h:248