MimIR 0.1
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::mem @ref mem
7namespace mim {
8namespace plug::mem {
9
10static constexpr plugin_t Plugin_Id = 0x3863800000000000;
11
12/// @name %%mem.M
13///@{
14enum class M : flags_t {
15};
16
17///@}
18
19/// @name %%mem.Ptr
20///@{
21enum class Ptr : flags_t {
22};
23
24///@}
25
26/// @name %%mem.Ptr0
27///@{
28enum class Ptr0 : flags_t {
29};
30
31///@}
32
33/// @name %%mem.load
34///@{
35enum class load : flags_t {
36};
37
38const Def* normalize_load(const Def*, const Def*, const Def*);
39///@}
40
41/// @name %%mem.store
42///@{
43enum class store : flags_t {
44};
45
46const Def* normalize_store(const Def*, const Def*, const Def*);
47///@}
48
49/// @name %%mem.remem
50///@{
51enum class remem : flags_t {
52};
53
54const Def* normalize_remem(const Def*, const Def*, const Def*);
55///@}
56
57/// @name %%mem.alloc
58///@{
59enum class alloc : flags_t {
60};
61
62///@}
63
64/// @name %%mem.slot
65///@{
66enum class slot : flags_t {
67};
68
69///@}
70
71/// @name %%mem.malloc
72///@{
73enum class malloc : flags_t {
74};
75
76///@}
77
78/// @name %%mem.free
79///@{
80enum class free : flags_t {
81};
82
83///@}
84
85/// @name %%mem.mslot
86///@{
87enum class mslot : flags_t {
88};
89
90///@}
91
92/// @name %%mem.lea
93///@{
94enum class lea : flags_t {
95};
96
97const Def* normalize_lea(const Def*, const Def*, const Def*);
98///@}
99
100/// @name %%mem.add_mem_phase
101///@{
102enum class add_mem_phase : flags_t {
103};
104
105///@}
106
107/// @name %%mem.remem_repl
108///@{
109enum class remem_repl : flags_t {
110};
111
112///@}
113
114/// @name %%mem.alloc2malloc_repl
115///@{
117};
118
119///@}
120
121/// @name %%mem.ssa_pass
122///@{
123enum class ssa_pass : flags_t {
124};
125
126///@}
127
128/// @name %%mem.copy_prop_pass
129///@{
131};
132
133///@}
134
135/// @name %%mem.reshape_mode
136///@{
137enum class reshape_mode : flags_t {
138};
139
140///@}
141
142/// @name %%mem.reshape_flat
143///@{
144enum class reshape_flat : flags_t {
145};
146
147///@}
148
149/// @name %%mem.reshape_arg
150///@{
151enum class reshape_arg : flags_t {
152};
153
154///@}
155
156/// @name %%mem.reshape_pass
157///@{
158enum class reshape_pass : flags_t {
159};
160
161///@}
162
164
165#define MIM_mem_NORMALIZER_IMPL \
166 void register_normalizers(Normalizers& normalizers) {\
167 normalizers[flags_t(Annex::Base<load>)] = &normalize_load; \
168 normalizers[flags_t(Annex::Base<store>)] = &normalize_store; \
169 normalizers[flags_t(Annex::Base<remem>)] = &normalize_remem; \
170 normalizers[flags_t(Annex::Base<lea>)] = &normalize_lea; \
171 }
172} // namespace plug::mem
173
174#ifndef DOXYGEN // don't include in Doxygen documentation
175
176template<> constexpr flags_t Annex::Base<plug::mem::M> = 0x3863800000000000;
177template<> constexpr size_t Annex::Num<plug::mem::M> = 0;
178template<> constexpr flags_t Annex::Base<plug::mem::Ptr> = 0x3863800000000100;
179template<> constexpr size_t Annex::Num<plug::mem::Ptr> = 0;
180template<> constexpr flags_t Annex::Base<plug::mem::Ptr0> = 0x3863800000000200;
181template<> constexpr size_t Annex::Num<plug::mem::Ptr0> = 0;
182template<> constexpr flags_t Annex::Base<plug::mem::load> = 0x3863800000000300;
183template<> constexpr size_t Annex::Num<plug::mem::load> = 0;
184template<> constexpr flags_t Annex::Base<plug::mem::store> = 0x3863800000000400;
185template<> constexpr size_t Annex::Num<plug::mem::store> = 0;
186template<> constexpr flags_t Annex::Base<plug::mem::remem> = 0x3863800000000500;
187template<> constexpr size_t Annex::Num<plug::mem::remem> = 0;
188template<> constexpr flags_t Annex::Base<plug::mem::alloc> = 0x3863800000000600;
189template<> constexpr size_t Annex::Num<plug::mem::alloc> = 0;
190template<> constexpr flags_t Annex::Base<plug::mem::slot> = 0x3863800000000700;
191template<> constexpr size_t Annex::Num<plug::mem::slot> = 0;
192template<> constexpr flags_t Annex::Base<plug::mem::malloc> = 0x3863800000000800;
193template<> constexpr size_t Annex::Num<plug::mem::malloc> = 0;
194template<> constexpr flags_t Annex::Base<plug::mem::free> = 0x3863800000000900;
195template<> constexpr size_t Annex::Num<plug::mem::free> = 0;
196template<> constexpr flags_t Annex::Base<plug::mem::mslot> = 0x3863800000000a00;
197template<> constexpr size_t Annex::Num<plug::mem::mslot> = 0;
198template<> constexpr flags_t Annex::Base<plug::mem::lea> = 0x3863800000000b00;
199template<> constexpr size_t Annex::Num<plug::mem::lea> = 0;
200template<> constexpr flags_t Annex::Base<plug::mem::add_mem_phase> = 0x3863800000000c00;
201template<> constexpr size_t Annex::Num<plug::mem::add_mem_phase> = 0;
202template<> constexpr flags_t Annex::Base<plug::mem::remem_repl> = 0x3863800000000d00;
203template<> constexpr size_t Annex::Num<plug::mem::remem_repl> = 0;
204template<> constexpr flags_t Annex::Base<plug::mem::alloc2malloc_repl> = 0x3863800000000e00;
205template<> constexpr size_t Annex::Num<plug::mem::alloc2malloc_repl> = 0;
206template<> constexpr flags_t Annex::Base<plug::mem::ssa_pass> = 0x3863800000000f00;
207template<> constexpr size_t Annex::Num<plug::mem::ssa_pass> = 0;
208template<> constexpr flags_t Annex::Base<plug::mem::copy_prop_pass> = 0x3863800000001000;
209template<> constexpr size_t Annex::Num<plug::mem::copy_prop_pass> = 0;
210template<> constexpr flags_t Annex::Base<plug::mem::reshape_mode> = 0x3863800000001100;
211template<> constexpr size_t Annex::Num<plug::mem::reshape_mode> = 0;
212template<> constexpr flags_t Annex::Base<plug::mem::reshape_flat> = 0x3863800000001200;
213template<> constexpr size_t Annex::Num<plug::mem::reshape_flat> = 0;
214template<> constexpr flags_t Annex::Base<plug::mem::reshape_arg> = 0x3863800000001300;
215template<> constexpr size_t Annex::Num<plug::mem::reshape_arg> = 0;
216template<> constexpr flags_t Annex::Base<plug::mem::reshape_pass> = 0x3863800000001400;
217template<> constexpr size_t Annex::Num<plug::mem::reshape_pass> = 0;
218
219template<> struct Axm::IsANode<plug::mem::Ptr0> { using type = Axm; };
220template<> struct Axm::IsANode<plug::mem::add_mem_phase> { using type = Axm; };
221template<> struct Axm::IsANode<plug::mem::remem_repl> { using type = Axm; };
222template<> struct Axm::IsANode<plug::mem::alloc2malloc_repl> { using type = Axm; };
223template<> struct Axm::IsANode<plug::mem::ssa_pass> { using type = Axm; };
224template<> struct Axm::IsANode<plug::mem::reshape_mode> { using type = Axm; };
225template<> struct Axm::IsANode<plug::mem::reshape_flat> { using type = Axm; };
226template<> struct Axm::IsANode<plug::mem::reshape_arg> { using type = Axm; };
227
228#endif
229} // namespace mim
230
231#ifndef DOXYGEN // don't include in Doxygen documentation
232
233
234#endif
Base class for all Defs.
Definition def.h:251
The mem Plugin
Definition mem.h:11
void register_normalizers(Normalizers &normalizers)
const Def * normalize_lea(const Def *, const Def *, const Def *arg)
const Def * normalize_remem(const Def *, const Def *, const Def *)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
const Def * normalize_store(const Def *, const Def *, const Def *arg)
const Def * normalize_load(const Def *type, const Def *, const Def *arg)
Definition ast.h:14
u64 flags_t
Definition types.h:45
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:46
@ Axm
Definition def.h:114
static constexpr size_t Num
Number of Axm::subtags.
Definition plugin.h:116
static constexpr flags_t Base
Definition plugin.h:117