Thorin 1.9.0
The Higher ORder INtermediate representation
Loading...
Searching...
No Matches
autogen.h
Go to the documentation of this file.
1#pragma once
2
3#include <thorin/axiom.h>
4#include <thorin/plugin.h>
5
6/// @namespace thorin::plug::mem @ref mem
7namespace thorin {
8namespace plug::mem {
9
10static constexpr plugin_t Plugin_Id = 0x3863800000000000;
11
12/// @name %%mem.M
13///@{
14#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
15enum M : flags_t {
16#else
17enum class M : flags_t {
18#endif
19};
20
21///@}
22
23/// @name %%mem.Ptr
24///@{
25#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
26enum Ptr : flags_t {
27#else
28enum class Ptr : flags_t {
29#endif
30};
31
32///@}
33
34/// @name %%mem.Ptr0
35///@{
36#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
37enum Ptr0 : flags_t {
38#else
39enum class Ptr0 : flags_t {
40#endif
41};
42
43///@}
44
45/// @name %%mem.load
46///@{
47#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
48enum load : flags_t {
49#else
50enum class load : flags_t {
51#endif
52};
53
55///@}
56
57/// @name %%mem.store
58///@{
59#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
60enum store : flags_t {
61#else
62enum class store : flags_t {
63#endif
64};
65
67///@}
68
69/// @name %%mem.remem
70///@{
71#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
72enum remem : flags_t {
73#else
74enum class remem : flags_t {
75#endif
76};
77
79///@}
80
81/// @name %%mem.alloc
82///@{
83#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
84enum alloc : flags_t {
85#else
86enum class alloc : flags_t {
87#endif
88};
89
90///@}
91
92/// @name %%mem.slot
93///@{
94#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
95enum slot : flags_t {
96#else
97enum class slot : flags_t {
98#endif
99};
100
101///@}
102
103/// @name %%mem.malloc
104///@{
105#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
107#else
108enum class malloc : flags_t {
109#endif
110};
111
112///@}
113
114/// @name %%mem.free
115///@{
116#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
117enum free : flags_t {
118#else
119enum class free : flags_t {
120#endif
121};
122
123///@}
124
125/// @name %%mem.mslot
126///@{
127#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
129#else
130enum class mslot : flags_t {
131#endif
132};
133
134///@}
135
136/// @name %%mem.lea
137///@{
138#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
139enum lea : flags_t {
140#else
141enum class lea : flags_t {
142#endif
143};
144
146///@}
147
148/// @name %%mem.m
149///@{
150#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
151enum m : flags_t {
152#else
153enum class m : flags_t {
154#endif
155};
156
157///@}
158
159/// @name %%mem.ignore
160///@{
161#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
163#else
164enum class ignore : flags_t {
165#endif
166};
167
168///@}
169
170/// @name %%mem.rm
171///@{
172#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
173enum rm : flags_t {
174#else
175enum class rm : flags_t {
176#endif
177};
178
179///@}
180
181/// @name %%mem.reshape_mode
182///@{
183#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
185#else
186enum class reshape_mode : flags_t {
187#endif
188};
189
190///@}
191
192/// @name %%mem.reshape_flat
193///@{
194#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
196#else
197enum class reshape_flat : flags_t {
198#endif
199};
200
201///@}
202
203/// @name %%mem.reshape_arg
204///@{
205#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
207#else
208enum class reshape_arg : flags_t {
209#endif
210};
211
212///@}
213
214/// @name %%mem.ssa_pass
215///@{
216#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
218#else
219enum class ssa_pass : flags_t {
220#endif
221};
222
223///@}
224
225/// @name %%mem.copy_prop_pass
226///@{
227#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
229#else
230enum class copy_prop_pass : flags_t {
231#endif
232};
233
234///@}
235
236/// @name %%mem.remem_elim_pass
237///@{
238#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
240#else
241enum class remem_elim_pass : flags_t {
242#endif
243};
244
245///@}
246
247/// @name %%mem.alloc2malloc_pass
248///@{
249#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
251#else
252enum class alloc2malloc_pass : flags_t {
253#endif
254};
255
256///@}
257
258/// @name %%mem.reshape_pass
259///@{
260#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
262#else
263enum class reshape_pass : flags_t {
264#endif
265};
266
267///@}
268
269/// @name %%mem.add_mem_phase
270///@{
271#ifdef DOXYGEN // see https://github.com/doxygen/doxygen/issues/9668
273#else
274enum class add_mem_phase : flags_t {
275#endif
276};
277
278///@}
279
281
282#define THORIN_mem_NORMALIZER_IMPL \
283 void register_normalizers(Normalizers& normalizers) {\
284 normalizers[flags_t(Annex::Base<load>)] = &normalize_load; \
285 normalizers[flags_t(Annex::Base<store>)] = &normalize_store; \
286 normalizers[flags_t(Annex::Base<remem>)] = &normalize_remem; \
287 normalizers[flags_t(Annex::Base<lea>)] = &normalize_lea; \
288 }
289} // namespace plug::mem
290
291#ifndef DOXYGEN // don't include in Doxygen documentation
292template<> constexpr flags_t Annex::Base<plug::mem::M> = 0x3863800000000000;
293template<> constexpr size_t Annex::Num<plug::mem::M> = 0;
294template<> constexpr flags_t Annex::Base<plug::mem::Ptr> = 0x3863800000000100;
295template<> constexpr size_t Annex::Num<plug::mem::Ptr> = 0;
296template<> constexpr flags_t Annex::Base<plug::mem::Ptr0> = 0x3863800000000200;
297template<> constexpr size_t Annex::Num<plug::mem::Ptr0> = 0;
298template<> constexpr flags_t Annex::Base<plug::mem::load> = 0x3863800000000300;
299template<> constexpr size_t Annex::Num<plug::mem::load> = 0;
300template<> constexpr flags_t Annex::Base<plug::mem::store> = 0x3863800000000400;
301template<> constexpr size_t Annex::Num<plug::mem::store> = 0;
302template<> constexpr flags_t Annex::Base<plug::mem::remem> = 0x3863800000000500;
303template<> constexpr size_t Annex::Num<plug::mem::remem> = 0;
304template<> constexpr flags_t Annex::Base<plug::mem::alloc> = 0x3863800000000600;
305template<> constexpr size_t Annex::Num<plug::mem::alloc> = 0;
306template<> constexpr flags_t Annex::Base<plug::mem::slot> = 0x3863800000000700;
307template<> constexpr size_t Annex::Num<plug::mem::slot> = 0;
308template<> constexpr flags_t Annex::Base<plug::mem::malloc> = 0x3863800000000800;
309template<> constexpr size_t Annex::Num<plug::mem::malloc> = 0;
310template<> constexpr flags_t Annex::Base<plug::mem::free> = 0x3863800000000900;
311template<> constexpr size_t Annex::Num<plug::mem::free> = 0;
312template<> constexpr flags_t Annex::Base<plug::mem::mslot> = 0x3863800000000a00;
313template<> constexpr size_t Annex::Num<plug::mem::mslot> = 0;
314template<> constexpr flags_t Annex::Base<plug::mem::lea> = 0x3863800000000b00;
315template<> constexpr size_t Annex::Num<plug::mem::lea> = 0;
316template<> constexpr flags_t Annex::Base<plug::mem::m> = 0x3863800000000c00;
317template<> constexpr size_t Annex::Num<plug::mem::m> = 0;
318template<> constexpr flags_t Annex::Base<plug::mem::ignore> = 0x3863800000000d00;
319template<> constexpr size_t Annex::Num<plug::mem::ignore> = 0;
320template<> constexpr flags_t Annex::Base<plug::mem::rm> = 0x3863800000000e00;
321template<> constexpr size_t Annex::Num<plug::mem::rm> = 0;
322template<> constexpr flags_t Annex::Base<plug::mem::reshape_mode> = 0x3863800000000f00;
323template<> constexpr size_t Annex::Num<plug::mem::reshape_mode> = 0;
324template<> constexpr flags_t Annex::Base<plug::mem::reshape_flat> = 0x3863800000001000;
325template<> constexpr size_t Annex::Num<plug::mem::reshape_flat> = 0;
326template<> constexpr flags_t Annex::Base<plug::mem::reshape_arg> = 0x3863800000001100;
327template<> constexpr size_t Annex::Num<plug::mem::reshape_arg> = 0;
328template<> constexpr flags_t Annex::Base<plug::mem::ssa_pass> = 0x3863800000001200;
329template<> constexpr size_t Annex::Num<plug::mem::ssa_pass> = 0;
330template<> constexpr flags_t Annex::Base<plug::mem::copy_prop_pass> = 0x3863800000001300;
331template<> constexpr size_t Annex::Num<plug::mem::copy_prop_pass> = 0;
332template<> constexpr flags_t Annex::Base<plug::mem::remem_elim_pass> = 0x3863800000001400;
333template<> constexpr size_t Annex::Num<plug::mem::remem_elim_pass> = 0;
334template<> constexpr flags_t Annex::Base<plug::mem::alloc2malloc_pass> = 0x3863800000001500;
335template<> constexpr size_t Annex::Num<plug::mem::alloc2malloc_pass> = 0;
336template<> constexpr flags_t Annex::Base<plug::mem::reshape_pass> = 0x3863800000001600;
337template<> constexpr size_t Annex::Num<plug::mem::reshape_pass> = 0;
338template<> constexpr flags_t Annex::Base<plug::mem::add_mem_phase> = 0x3863800000001700;
339template<> constexpr size_t Annex::Num<plug::mem::add_mem_phase> = 0;
340
341template<> struct Axiom::Match<plug::mem::M> { using type = Axiom; };
342template<> struct Axiom::Match<plug::mem::Ptr0> { using type = Axiom; };
343template<> struct Axiom::Match<plug::mem::m> { using type = Axiom; };
344template<> struct Axiom::Match<plug::mem::ignore> { using type = Axiom; };
345template<> struct Axiom::Match<plug::mem::rm> { using type = Axiom; };
346template<> struct Axiom::Match<plug::mem::reshape_mode> { using type = Axiom; };
347template<> struct Axiom::Match<plug::mem::reshape_flat> { using type = Axiom; };
348template<> struct Axiom::Match<plug::mem::reshape_arg> { using type = Axiom; };
349template<> struct Axiom::Match<plug::mem::remem_elim_pass> { using type = Axiom; };
350template<> struct Axiom::Match<plug::mem::alloc2malloc_pass> { using type = Axiom; };
351template<> struct Axiom::Match<plug::mem::add_mem_phase> { using type = Axiom; };
352#endif
353} // namespace thorin
Helper class to retrieve Infer::arg if present.
Definition def.h:87
@ Axiom
Definition def.h:41
Ref normalize_load(Ref type, Ref callee, Ref arg)
Ref normalize_store(Ref type, Ref callee, Ref arg)
Ref normalize_lea(Ref type, Ref callee, Ref arg)
Ref normalize_remem(Ref type, Ref callee, Ref mem)
void register_normalizers(Normalizers &normalizers)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
Definition cfg.h:11
absl::flat_hash_map< flags_t, NormalizeFn > Normalizers
Definition plugin.h:19
u64 plugin_t
Definition types.h:47
u64 flags_t
Definition types.h:46
static constexpr flags_t Base
Definition plugin.h:131