MimIR
0.4-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
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
7
namespace
mim
{
8
namespace
plug::compile
{
9
10
static
constexpr
plugin_t
Plugin_Id
= 0x11039128d1800000;
11
12
/// @name %%compile.Phase
13
///@{
14
enum class
Phase
:
flags_t
{
15
};
16
17
///@}
18
19
/// @name %%compile.aggr
20
///@{
21
enum class
aggr
:
flags_t
{
22
};
23
24
const
Def
*
normalize_aggr
(
const
Def
*,
const
Def
*,
const
Def
*);
25
///@}
26
27
/// @name %%compile.cond
28
///@{
29
enum class
cond
:
flags_t
{
30
};
31
32
const
Def
*
normalize_cond
(
const
Def
*,
const
Def
*,
const
Def
*);
33
///@}
34
35
/// @name %%compile.is_loaded
36
///@{
37
enum class
is_loaded
:
flags_t
{
38
};
39
40
const
Def
*
normalize_is_loaded
(
const
Def
*,
const
Def
*,
const
Def
*);
41
///@}
42
43
/// @name %%compile.named
44
///@{
45
enum class
named
:
flags_t
{
46
};
47
48
///@}
49
50
/// @name %%compile.phases
51
///@{
52
enum class
phases
:
flags_t
{
53
};
54
55
///@}
56
57
/// @name %%compile.beta_red
58
///@{
59
enum class
beta_red
:
flags_t
{
60
};
61
62
///@}
63
64
/// @name %%compile.branch_normalize
65
///@{
66
enum class
branch_normalize
:
flags_t
{
67
};
68
69
///@}
70
71
/// @name %%compile.cleanup
72
///@{
73
enum class
cleanup
:
flags_t
{
74
};
75
76
///@}
77
78
/// @name %%compile.eta_conv
79
///@{
80
enum class
eta_conv
:
flags_t
{
81
};
82
83
///@}
84
85
/// @name %%compile.lam_spec
86
///@{
87
enum class
lam_spec
:
flags_t
{
88
};
89
90
///@}
91
92
/// @name %%compile.null
93
///@{
94
enum class
null
:
flags_t
{
95
};
96
97
///@}
98
99
/// @name %%compile.ret_wrap
100
///@{
101
enum class
ret_wrap
:
flags_t
{
102
};
103
104
///@}
105
106
/// @name %%compile.scalarize
107
///@{
108
enum class
scalarize
:
flags_t
{
109
};
110
111
///@}
112
113
/// @name %%compile.static_arg_opt
114
///@{
115
enum class
static_arg_opt
:
flags_t
{
116
};
117
118
///@}
119
120
/// @name %%compile.unload
121
///@{
122
enum class
unload
:
flags_t
{
123
};
124
125
///@}
126
127
void
register_normalizers
(
Normalizers
& normalizers);
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
139
template
<>
constexpr
flags_t
Annex::Base<plug::compile::Phase>
= 0x11039128d1800000;
140
template
<>
constexpr
size_t
Annex::Num<plug::compile::Phase>
= 0;
141
template
<>
constexpr
flags_t
Annex::Base<plug::compile::aggr>
= 0x11039128d1800100;
142
template
<>
constexpr
size_t
Annex::Num<plug::compile::aggr>
= 0;
143
template
<>
constexpr
flags_t
Annex::Base<plug::compile::cond>
= 0x11039128d1800200;
144
template
<>
constexpr
size_t
Annex::Num<plug::compile::cond>
= 0;
145
template
<>
constexpr
flags_t
Annex::Base<plug::compile::is_loaded>
= 0x11039128d1800300;
146
template
<>
constexpr
size_t
Annex::Num<plug::compile::is_loaded>
= 0;
147
template
<>
constexpr
flags_t
Annex::Base<plug::compile::named>
= 0x11039128d1800400;
148
template
<>
constexpr
size_t
Annex::Num<plug::compile::named>
= 0;
149
template
<>
constexpr
flags_t
Annex::Base<plug::compile::phases>
= 0x11039128d1800500;
150
template
<>
constexpr
size_t
Annex::Num<plug::compile::phases>
= 0;
151
template
<>
constexpr
flags_t
Annex::Base<plug::compile::beta_red>
= 0x11039128d1800600;
152
template
<>
constexpr
size_t
Annex::Num<plug::compile::beta_red>
= 0;
153
template
<>
constexpr
flags_t
Annex::Base<plug::compile::branch_normalize>
= 0x11039128d1800700;
154
template
<>
constexpr
size_t
Annex::Num<plug::compile::branch_normalize>
= 0;
155
template
<>
constexpr
flags_t
Annex::Base<plug::compile::cleanup>
= 0x11039128d1800800;
156
template
<>
constexpr
size_t
Annex::Num<plug::compile::cleanup>
= 0;
157
template
<>
constexpr
flags_t
Annex::Base<plug::compile::eta_conv>
= 0x11039128d1800900;
158
template
<>
constexpr
size_t
Annex::Num<plug::compile::eta_conv>
= 0;
159
template
<>
constexpr
flags_t
Annex::Base<plug::compile::lam_spec>
= 0x11039128d1800a00;
160
template
<>
constexpr
size_t
Annex::Num<plug::compile::lam_spec>
= 0;
161
template
<>
constexpr
flags_t
Annex::Base<plug::compile::null>
= 0x11039128d1800b00;
162
template
<>
constexpr
size_t
Annex::Num<plug::compile::null>
= 0;
163
template
<>
constexpr
flags_t
Annex::Base<plug::compile::ret_wrap>
= 0x11039128d1800c00;
164
template
<>
constexpr
size_t
Annex::Num<plug::compile::ret_wrap>
= 0;
165
template
<>
constexpr
flags_t
Annex::Base<plug::compile::scalarize>
= 0x11039128d1800d00;
166
template
<>
constexpr
size_t
Annex::Num<plug::compile::scalarize>
= 0;
167
template
<>
constexpr
flags_t
Annex::Base<plug::compile::static_arg_opt>
= 0x11039128d1800e00;
168
template
<>
constexpr
size_t
Annex::Num<plug::compile::static_arg_opt>
= 0;
169
template
<>
constexpr
flags_t
Annex::Base<plug::compile::unload>
= 0x11039128d1800f00;
170
template
<>
constexpr
size_t
Annex::Num<plug::compile::unload>
= 0;
171
172
template
<>
struct
Axm::IsANode
<
plug
::compile::Phase> {
using
type
=
Axm
; };
173
template
<>
struct
Axm::IsANode
<
plug
::compile::beta_red> {
using
type
=
Axm
; };
174
template
<>
struct
Axm::IsANode
<
plug
::compile::branch_normalize> {
using
type
=
Axm
; };
175
template
<>
struct
Axm::IsANode
<
plug
::compile::cleanup> {
using
type
=
Axm
; };
176
template
<>
struct
Axm::IsANode
<
plug
::compile::eta_conv> {
using
type
=
Axm
; };
177
template
<>
struct
Axm::IsANode
<
plug
::compile::lam_spec> {
using
type
=
Axm
; };
178
template
<>
struct
Axm::IsANode
<
plug
::compile::null> {
using
type
=
Axm
; };
179
template
<>
struct
Axm::IsANode
<
plug
::compile::ret_wrap> {
using
type
=
Axm
; };
180
template
<>
struct
Axm::IsANode
<
plug
::compile::scalarize> {
using
type
=
Axm
; };
181
template
<>
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
axm.h
mim::Axm::IsANode::type
App type
Definition
axm.h:70
mim::Axm::IsANode
Definition
axm.h:69
mim::Def
Base class for all Defs.
Definition
def.h:273
mim::plug::compile
The compile Plugin
Definition
normalizers.cpp:7
mim::plug::compile::lam_spec
lam_spec
Definition
autogen.h:87
mim::plug::compile::aggr
aggr
Definition
autogen.h:21
mim::plug::compile::normalize_cond
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.
Definition
normalizers.cpp:26
mim::plug::compile::phases
phases
Definition
autogen.h:52
mim::plug::compile::branch_normalize
branch_normalize
Definition
autogen.h:66
mim::plug::compile::register_normalizers
void register_normalizers(Normalizers &normalizers)
mim::plug::compile::null
null
Definition
autogen.h:94
mim::plug::compile::static_arg_opt
static_arg_opt
Definition
autogen.h:115
mim::plug::compile::unload
unload
Definition
autogen.h:122
mim::plug::compile::is_loaded
is_loaded
Definition
autogen.h:37
mim::plug::compile::eta_conv
eta_conv
Definition
autogen.h:80
mim::plug::compile::ret_wrap
ret_wrap
Definition
autogen.h:101
mim::plug::compile::normalize_is_loaded
const Def * normalize_is_loaded(const Def *, const Def *, const Def *arg)
Definition
normalizers.cpp:9
mim::plug::compile::Phase
Phase
Definition
autogen.h:14
mim::plug::compile::cond
cond
Definition
autogen.h:29
mim::plug::compile::scalarize
scalarize
Definition
autogen.h:108
mim::plug::compile::beta_red
beta_red
Definition
autogen.h:59
mim::plug::compile::named
named
Definition
autogen.h:45
mim::plug::compile::cleanup
cleanup
Definition
autogen.h:73
mim::plug::compile::Plugin_Id
static constexpr plugin_t Plugin_Id
Definition
autogen.h:10
mim::plug::compile::normalize_aggr
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
normalizers.cpp:18
mim::plug
Definition
lower_for.h:5
mim
Definition
ast.h:16
mim::flags_t
u64 flags_t
Definition
types.h:39
mim::Normalizers
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition
plugin.h:27
mim::plugin_t
u64 plugin_t
Definition
types.h:40
mim::Node::Axm
@ Axm
Definition
def.h:122
plugin.h
mim::Annex::Num
static constexpr size_t Num
Number of Axm::subtags.
Definition
plugin.h:247
mim::Annex::Base
static constexpr flags_t Base
Definition
plugin.h:248
build
include
mim
plug
compile
autogen.h
Generated by
1.18.0