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/axiom.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
39///@}
40
41/// @name %%mem.store
42///@{
43enum class store : flags_t {
44};
45
47///@}
48
49/// @name %%mem.remem
50///@{
51enum class remem : flags_t {
52};
53
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
98///@}
99
100/// @name %%mem.m
101///@{
102enum class m : flags_t {
103};
104
105///@}
106
107/// @name %%mem.ignore
108///@{
109enum class ignore : flags_t {
110};
111
112///@}
113
114/// @name %%mem.rm
115///@{
116enum class rm : flags_t {
117};
118
119///@}
120
121/// @name %%mem.reshape_mode
122///@{
123enum class reshape_mode : flags_t {
124};
125
126///@}
127
128/// @name %%mem.reshape_flat
129///@{
130enum class reshape_flat : flags_t {
131};
132
133///@}
134
135/// @name %%mem.reshape_arg
136///@{
137enum class reshape_arg : flags_t {
138};
139
140///@}
141
142/// @name %%mem.ssa_pass
143///@{
144enum class ssa_pass : flags_t {
145};
146
147///@}
148
149/// @name %%mem.copy_prop_pass
150///@{
152};
153
154///@}
155
156/// @name %%mem.remem_elim_pass
157///@{
159};
160
161///@}
162
163/// @name %%mem.alloc2malloc_pass
164///@{
166};
167
168///@}
169
170/// @name %%mem.reshape_pass
171///@{
172enum class reshape_pass : flags_t {
173};
174
175///@}
176
177/// @name %%mem.add_mem_phase
178///@{
179enum class add_mem_phase : flags_t {
180};
181
182///@}
183
185
186#define MIM_mem_NORMALIZER_IMPL \
187 void register_normalizers(Normalizers& normalizers) {\
188 normalizers[flags_t(Annex::Base<load>)] = &normalize_load; \
189 normalizers[flags_t(Annex::Base<store>)] = &normalize_store; \
190 normalizers[flags_t(Annex::Base<remem>)] = &normalize_remem; \
191 normalizers[flags_t(Annex::Base<lea>)] = &normalize_lea; \
192 }
193} // namespace plug::mem
194
195#ifndef DOXYGEN // don't include in Doxygen documentation
196
197template<> constexpr flags_t Annex::Base<plug::mem::M> = 0x3863800000000000;
198template<> constexpr size_t Annex::Num<plug::mem::M> = 0;
199template<> constexpr flags_t Annex::Base<plug::mem::Ptr> = 0x3863800000000100;
200template<> constexpr size_t Annex::Num<plug::mem::Ptr> = 0;
201template<> constexpr flags_t Annex::Base<plug::mem::Ptr0> = 0x3863800000000200;
202template<> constexpr size_t Annex::Num<plug::mem::Ptr0> = 0;
203template<> constexpr flags_t Annex::Base<plug::mem::load> = 0x3863800000000300;
204template<> constexpr size_t Annex::Num<plug::mem::load> = 0;
205template<> constexpr flags_t Annex::Base<plug::mem::store> = 0x3863800000000400;
206template<> constexpr size_t Annex::Num<plug::mem::store> = 0;
207template<> constexpr flags_t Annex::Base<plug::mem::remem> = 0x3863800000000500;
208template<> constexpr size_t Annex::Num<plug::mem::remem> = 0;
209template<> constexpr flags_t Annex::Base<plug::mem::alloc> = 0x3863800000000600;
210template<> constexpr size_t Annex::Num<plug::mem::alloc> = 0;
211template<> constexpr flags_t Annex::Base<plug::mem::slot> = 0x3863800000000700;
212template<> constexpr size_t Annex::Num<plug::mem::slot> = 0;
213template<> constexpr flags_t Annex::Base<plug::mem::malloc> = 0x3863800000000800;
214template<> constexpr size_t Annex::Num<plug::mem::malloc> = 0;
215template<> constexpr flags_t Annex::Base<plug::mem::free> = 0x3863800000000900;
216template<> constexpr size_t Annex::Num<plug::mem::free> = 0;
217template<> constexpr flags_t Annex::Base<plug::mem::mslot> = 0x3863800000000a00;
218template<> constexpr size_t Annex::Num<plug::mem::mslot> = 0;
219template<> constexpr flags_t Annex::Base<plug::mem::lea> = 0x3863800000000b00;
220template<> constexpr size_t Annex::Num<plug::mem::lea> = 0;
221template<> constexpr flags_t Annex::Base<plug::mem::m> = 0x3863800000000c00;
222template<> constexpr size_t Annex::Num<plug::mem::m> = 0;
223template<> constexpr flags_t Annex::Base<plug::mem::ignore> = 0x3863800000000d00;
224template<> constexpr size_t Annex::Num<plug::mem::ignore> = 0;
225template<> constexpr flags_t Annex::Base<plug::mem::rm> = 0x3863800000000e00;
226template<> constexpr size_t Annex::Num<plug::mem::rm> = 0;
227template<> constexpr flags_t Annex::Base<plug::mem::reshape_mode> = 0x3863800000000f00;
228template<> constexpr size_t Annex::Num<plug::mem::reshape_mode> = 0;
229template<> constexpr flags_t Annex::Base<plug::mem::reshape_flat> = 0x3863800000001000;
230template<> constexpr size_t Annex::Num<plug::mem::reshape_flat> = 0;
231template<> constexpr flags_t Annex::Base<plug::mem::reshape_arg> = 0x3863800000001100;
232template<> constexpr size_t Annex::Num<plug::mem::reshape_arg> = 0;
233template<> constexpr flags_t Annex::Base<plug::mem::ssa_pass> = 0x3863800000001200;
234template<> constexpr size_t Annex::Num<plug::mem::ssa_pass> = 0;
235template<> constexpr flags_t Annex::Base<plug::mem::copy_prop_pass> = 0x3863800000001300;
236template<> constexpr size_t Annex::Num<plug::mem::copy_prop_pass> = 0;
237template<> constexpr flags_t Annex::Base<plug::mem::remem_elim_pass> = 0x3863800000001400;
238template<> constexpr size_t Annex::Num<plug::mem::remem_elim_pass> = 0;
239template<> constexpr flags_t Annex::Base<plug::mem::alloc2malloc_pass> = 0x3863800000001500;
240template<> constexpr size_t Annex::Num<plug::mem::alloc2malloc_pass> = 0;
241template<> constexpr flags_t Annex::Base<plug::mem::reshape_pass> = 0x3863800000001600;
242template<> constexpr size_t Annex::Num<plug::mem::reshape_pass> = 0;
243template<> constexpr flags_t Annex::Base<plug::mem::add_mem_phase> = 0x3863800000001700;
244template<> constexpr size_t Annex::Num<plug::mem::add_mem_phase> = 0;
245
246template<> struct Axiom::Match<plug::mem::M> { using type = Axiom; };
247template<> struct Axiom::Match<plug::mem::Ptr0> { using type = Axiom; };
248template<> struct Axiom::Match<plug::mem::m> { using type = Axiom; };
249template<> struct Axiom::Match<plug::mem::ignore> { using type = Axiom; };
250template<> struct Axiom::Match<plug::mem::rm> { using type = Axiom; };
251template<> struct Axiom::Match<plug::mem::reshape_mode> { using type = Axiom; };
252template<> struct Axiom::Match<plug::mem::reshape_flat> { using type = Axiom; };
253template<> struct Axiom::Match<plug::mem::reshape_arg> { using type = Axiom; };
254template<> struct Axiom::Match<plug::mem::remem_elim_pass> { using type = Axiom; };
255template<> struct Axiom::Match<plug::mem::alloc2malloc_pass> { using type = Axiom; };
256template<> struct Axiom::Match<plug::mem::add_mem_phase> { using type = Axiom; };
257
258#endif
259} // namespace mim
260
261#ifndef DOXYGEN // don't include in Doxygen documentation
262
263
264#endif
Helper class to retrieve Infer::arg if present.
Definition def.h:86
void register_normalizers(Normalizers &normalizers)
Ref normalize_lea(Ref type, Ref callee, Ref arg)
Ref normalize_remem(Ref type, Ref callee, Ref mem)
Ref normalize_store(Ref type, Ref callee, Ref arg)
static constexpr plugin_t Plugin_Id
Definition autogen.h:10
Ref normalize_load(Ref type, Ref callee, Ref arg)
Definition cfg.h:11
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
static constexpr size_t Num
Definition plugin.h:115
static constexpr flags_t Base
Definition plugin.h:118