-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd__mem_8cpp_source.html
More file actions
373 lines (371 loc) · 64.4 KB
/
Copy pathadd__mem_8cpp_source.html
File metadata and controls
373 lines (371 loc) · 64.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
<!-- HTML header for doxygen 1.9.3-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.16.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MimIR: src/mim/plug/mem/phase/add_mem.cpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="doxygen-awesome-darkmode-toggle.js"></script>
<script type="text/javascript" src="doxygen-awesome-fragment-copy-button.js"></script>
<script type="text/javascript" src="doxygen-awesome-interactive-toc.js"></script>
<script type="text/javascript" src="doxygen-awesome-paragraph-link.js"></script>
<script type="text/javascript">
DoxygenAwesomeDarkModeToggle.init()
DoxygenAwesomeFragmentCopyButton.init()
DoxygenAwesomeInteractiveToc.init()
DoxygenAwesomeParagraphLink.init()
</script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-interactive-toc.js" rel="stylesheet" type="text/css"/>
<link href="custom.css" rel="stylesheet" type="text/css"/>
<link href="version-switcher.css" rel="stylesheet" type="text/css"/>
<link href="dotgraph.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- https://tholman.com/github-corners/ -->
<a href="https://github.com/mimir/mimir" class="github-corner" title="View source on GitHub">
<svg viewBox="0 0 250 250" style="position: absolute; top: 0; border: 0; right: 0;" aria-hidden="true">
<path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a><style>.github-corner:hover .octo-arm{animation:octocat-wave 560ms ease-in-out}@keyframes octocat-wave{0%,100%{transform:rotate(0)}20%,60%{transform:rotate(-25deg)}40%,80%{transform:rotate(10deg)}}@media (max-width:500px){.github-corner:hover .octo-arm{animation:none}.github-corner .octo-arm{animation:octocat-wave 560ms ease-in-out}}</style>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectlogo"><a href="https://github.com/mimir"><img alt="Logo" src="logo.svg"/></a></td>
<td id="projectalign">
<div id="projectname">MimIR
<div id="projectnumber" class="version-switcher" data-manifest="versions.json">
<button class="version-switcher__button" type="button" aria-expanded="false" aria-haspopup="true">0.3-dev</button>
<div class="version-switcher__menu" hidden></div>
</div>
<script type="text/javascript" src="version-switcher.js"></script>
</div>
<div id="projectbrief">MimIR is my Intermediate Representation</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.16.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search/",'.html');
</script>
<script type="text/javascript">
$(function() { codefold.init(); });
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search',true);
$(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(function(){initNavTree('add__mem_8cpp_source.html','',''); });
</script>
<div id="container">
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>
<div class="header">
<div class="headertitle"><div class="title">add_mem.cpp</div></div>
</div><!--header-->
<div class="contents">
<a href="add__mem_8cpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#include "<a class="code" href="add__mem_8h.html">mim/plug/mem/phase/add_mem.h</a>"</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span> </div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include <utility></span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span> </div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include <<a class="code" href="util_8h.html">mim/util/util.h</a>></span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="preprocessor">#include "<a class="code" href="mem_8h.html">mim/plug/mem/mem.h</a>"</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span> </div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="comment">// TODO make parametric in address space</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespacemim_1_1plug_1_1mem_1_1phase.html">mim::plug::mem::phase</a> {</div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
<div class="foldopen" id="foldopen00013" data-start="{" data-end="}">
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"><a class="line" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ae89382deb0efbc5696abfa447c5b7993"> 13</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ae89382deb0efbc5696abfa447c5b7993">AddMem::start</a>() {</div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> <span class="comment">// Collect the lams whose ABI is pinned: everything (transitively) reachable from an axm-app argument</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span> <span class="comment">// (combiners, affine index mappings, initial accumulators of `%matrix.map_reduce_aff`, …).</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <a class="code hl_class" href="classmim_1_1unique__queue.html">unique_queue<DefSet></a> roots;</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> mut : <a class="code hl_function" href="classmim_1_1RWPhase.html#aef58721bd5f8d89e624eea65ff51f6b3">old_world</a>().externals().muts())</div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> <span class="keywordflow">if</span> (mut) roots.<a class="code hl_function" href="classmim_1_1unique__queue.html#ad2d075da9d644427c35f019ca2b5bb9e">push</a>(mut);</div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> </div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <a class="code hl_class" href="classmim_1_1unique__queue.html">unique_queue<DefSet></a> pinned;</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keywordflow">while</span> (!roots.<a class="code hl_function" href="classmim_1_1unique__queue.html#a1d2b139e34bfc51d1cd42c7fb1244fd8">empty</a>()) {</div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">auto</span> def = roots.<a class="code hl_function" href="classmim_1_1unique__queue.html#a2e9f9f38db1723c6a77fe4f75a6efdb6">pop</a>();</div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> app = def->isa<<a class="code hl_class" href="classmim_1_1App.html">App</a>>(); app && app-><a class="code hl_function" href="classmim_1_1App.html#a29ef71935ad4ef6bdf94419a406aaa3b">axm</a>())</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> arg : app->arg()->projs())</div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> lam = arg->isa_mut<<a class="code hl_class" href="classmim_1_1Lam.html">Lam</a>>()) pinned.<a class="code hl_function" href="classmim_1_1unique__queue.html#ad2d075da9d644427c35f019ca2b5bb9e">push</a>(lam);</div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> op : def->ops())</div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> <span class="keywordflow">if</span> (op) roots.<a class="code hl_function" href="classmim_1_1unique__queue.html#ad2d075da9d644427c35f019ca2b5bb9e">push</a>(op);</div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> }</div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keywordflow">while</span> (!pinned.<a class="code hl_function" href="classmim_1_1unique__queue.html#a1d2b139e34bfc51d1cd42c7fb1244fd8">empty</a>()) {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <span class="keyword">auto</span> def = pinned.<a class="code hl_function" href="classmim_1_1unique__queue.html#a2e9f9f38db1723c6a77fe4f75a6efdb6">pop</a>();</div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> lam = def->isa_mut<<a class="code hl_class" href="classmim_1_1Lam.html">Lam</a>>()) preserved_.emplace(lam);</div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> <span class="keywordflow">for</span> (<span class="keyword">auto</span> op : def->ops())</div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> <span class="keywordflow">if</span> (op) pinned.<a class="code hl_function" href="classmim_1_1unique__queue.html#ad2d075da9d644427c35f019ca2b5bb9e">push</a>(op);</div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> }</div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <a class="code hl_function" href="classmim_1_1RWPhase.html#a8f18849b836d888382aed5b2bcc249f8">RWPhase::start</a>();</div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span>}</div>
</div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div>
<div class="foldopen" id="foldopen00039" data-start="{" data-end="}">
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886"> 39</a></span><span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">AddMem::rewrite</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* old_def) {</div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> <span class="comment">// Rewrite every memory operand to the current memory - after threading the operand's producers, which</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> <span class="comment">// advances curr_mem_ along the way. Placeholders (`⊥`/`⊤ : %mem.M 0`) are thereby spliced into the chain.</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> <span class="keywordflow">if</span> (curr_mem_ && !preserving_ && !<a class="code hl_function" href="classmim_1_1RWPhase.html#a8c1256f93cc63c1d8d0609e2aa474b51">is_bootstrapping</a>() && !old_def-><a class="code hl_function" href="classmim_1_1Def.html#a53a70702795d9c4bafe6de0d4f4a66f1">isa_mut</a>() && <a class="code hl_function" href="namespacemim_1_1plug_1_1mem.html#ada840448f31c6d5165bd35848433793b">isa_mem</a>(old_def)) {</div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> <a class="code hl_function" href="classmim_1_1Rewriter.html#acd9201feaab8a6d73223308e48ff6652">Rewriter::rewrite</a>(old_def);</div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span> <span class="keywordflow">return</span> curr_mem_;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> }</div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span> <span class="keywordflow">return</span> <a class="code hl_function" href="classmim_1_1Rewriter.html#acd9201feaab8a6d73223308e48ff6652">Rewriter::rewrite</a>(old_def);</div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno"> 47</span>}</div>
</div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno"> 48</span> </div>
<div class="foldopen" id="foldopen00049" data-start="{" data-end="}">
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno"><a class="line" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#a4c007a711229208593f254b527d0190f"> 49</a></span><span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#a4c007a711229208593f254b527d0190f">AddMem::rewrite_imm_Pi</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Pi.html">Pi</a>* pi) {</div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">auto</span> new_pi = Rewriter::rewrite_imm_Pi(pi)->as<<a class="code hl_class" href="classmim_1_1Pi.html">Pi</a>>();</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"> 51</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmim_1_1RWPhase.html#a8c1256f93cc63c1d8d0609e2aa474b51">is_bootstrapping</a>() || preserving_) <span class="keywordflow">return</span> new_pi;</div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"> 52</span> </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"> 53</span> <span class="comment">// Only continuations are mem-extended; a pi that already threads memory is left alone.</span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmim_1_1Pi.html#a60c2d05d18e618930742433ce71e0a61">Pi::isa_cn</a>(pi) && !<a class="code hl_function" href="namespacemim_1_1plug_1_1mem.html#a0b3a4f02c49f44380ce8b9e83a5affc5">has_leading_mem</a>(pi)) {</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"> 55</span> <span class="keyword">auto</span>& w = <a class="code hl_function" href="classmim_1_1RWPhase.html#a0f7249ac3c85d2f2b1d7c72455c61b19">new_world</a>();</div>
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keyword">auto</span> <a class="code hl_namespace" href="namespacemim_1_1plug_1_1mem.html">mem</a> = w.call<<a class="code hl_enumeration" href="namespacemim_1_1plug_1_1mem.html#a44127c99fa94a5143565463d65206ea6">mem::M</a>>(0);</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">auto</span> dom = new_pi->dom();</div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="comment">// A dependent domain refers to its own Var.</span></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> <span class="comment">// So prepending a leading mem shifts every component's index by one.</span></div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// Rebuild the domain as a fresh mutable Sigma and remap the old domain-Var to the shifted components of the new</span></div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="comment">// one. Otherwise the dependent references dangle (see issue #177).</span></div>
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> sigma = dom->isa_mut<<a class="code hl_class" href="classmim_1_1Sigma.html">Sigma</a>>(); sigma && sigma-><a class="code hl_function" href="classmim_1_1Def.html#af82f20111e9f1cbdbf910d30341bd4ee">has_var</a>()) {</div>
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> <span class="keyword">auto</span> n = sigma->num_ops();</div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="keyword">auto</span> old_var = sigma->has_var();</div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> <span class="keyword">auto</span> new_sigma = w.mut_sigma(sigma->type(), n + 1);</div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> new_sigma->set(0, <a class="code hl_namespace" href="namespacemim_1_1plug_1_1mem.html">mem</a>);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> <span class="comment">// Component `i` may only refer to earlier components, whose (index-shifted) new Vars are already</span></div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> <span class="comment">// set - so build the substitution per component; padding slots `≥ i` are never extracted.</span></div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i != n; ++i) {</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span> <span class="keyword">auto</span> shift = w.tuple(<a class="code hl_typedef" href="namespacemim.html#a1433b0566b2cbdbf0c6f74baed22bb52">DefVec</a>(n, [&](<span class="keywordtype">size_t</span> j) { <span class="keywordflow">return</span> j < i ? new_sigma->var(n + 1, j + 1) : <a class="code hl_namespace" href="namespacemim_1_1plug_1_1mem.html">mem</a>; }));</div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> <span class="keyword">auto</span> rw = <a class="code hl_class" href="classmim_1_1VarRewriter.html">VarRewriter</a>(old_var, shift);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"> 73</span> new_sigma->set(i + 1, rw.rewrite(sigma->op(i)));</div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"> 74</span> }</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno"> 75</span> <span class="keywordflow">return</span> w.cn(new_sigma);</div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno"> 76</span> }</div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno"> 77</span> </div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span> <span class="keyword">auto</span> new_dom = <a class="code hl_typedef" href="namespacemim.html#a1433b0566b2cbdbf0c6f74baed22bb52">DefVec</a>();</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"> 79</span> new_dom.emplace_back(<a class="code hl_namespace" href="namespacemim_1_1plug_1_1mem.html">mem</a>);</div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0, e = new_pi->num_doms(); i != e; ++i)</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> new_dom.emplace_back(new_pi->dom(i));</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"> 82</span> <span class="keywordflow">return</span> w.cn(new_dom);</div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"> 83</span> }</div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"> 84</span> <span class="keywordflow">return</span> new_pi;</div>
<div class="line"><a id="l00085" name="l00085"></a><span class="lineno"> 85</span>}</div>
</div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"> 86</span> </div>
<div class="foldopen" id="foldopen00087" data-start="{" data-end="}">
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#abad7748a99cb8b1f0db81db03afb417c"> 87</a></span><span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#abad7748a99cb8b1f0db81db03afb417c">AddMem::rewrite_mut_Lam</a>(<a class="code hl_class" href="classmim_1_1Lam.html">Lam</a>* old_lam) {</div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno"> 88</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmim_1_1RWPhase.html#a8c1256f93cc63c1d8d0609e2aa474b51">is_bootstrapping</a>() || preserving_) <span class="keywordflow">return</span> Rewriter::rewrite_mut_Lam(old_lam);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"> 89</span> </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"> 90</span> <span class="comment">// Pinned ABI (an axm-app argument and everything below it): rewrite verbatim - no memory threaded or added.</span></div>
<div class="line"><a id="l00091" name="l00091"></a><span class="lineno"> 91</span> <span class="keywordflow">if</span> (preserved_.contains(old_lam)) {</div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"> 92</span> <span class="keyword">auto</span> save = std::exchange(preserving_, <span class="keyword">true</span>);</div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"> 93</span> <span class="keyword">auto</span> new_it = Rewriter::rewrite_mut_Lam(old_lam);</div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"> 94</span> preserving_ = save;</div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"> 95</span> <span class="keywordflow">return</span> new_it;</div>
<div class="line"><a id="l00096" name="l00096"></a><span class="lineno"> 96</span> }</div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"> 98</span> <span class="keyword">auto</span> new_lam = <a class="code hl_function" href="classmim_1_1RWPhase.html#a0f7249ac3c85d2f2b1d7c72455c61b19">new_world</a>().<a class="code hl_function" href="classmim_1_1World.html#afa7919f0e7f69f2451aedd9da912c857">mut_lam</a>(<a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">rewrite</a>(old_lam-><a class="code hl_function" href="classmim_1_1Lam.html#a6380ad84433a405f9e2a7695ecffa6b3">type</a>())->as<<a class="code hl_class" href="classmim_1_1Pi.html">Pi</a>>())-><a class="code hl_function" href="classmim_1_1Lam.html#a24231a9b2503394cd8a54128a043db1b">set</a>(old_lam-><a class="code hl_function" href="classmim_1_1Def.html#aefa7b1a57b3a67d30070c9aa9d3b20b3">dbg</a>());</div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <a class="code hl_function" href="classmim_1_1Rewriter.html#a832644b4df14efed752cba8e8568aca4">map</a>(old_lam, new_lam);</div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> </div>
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> <span class="comment">// Map the parameters, accounting for a possibly inserted leading mem var.</span></div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> n = old_lam-><a class="code hl_function" href="classmim_1_1Def.html#a84ee4f56868a620ccf508d9044212fad">num_vars</a>(); n != 0) {</div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keyword">auto</span> offset = new_lam->num_doms() - old_lam->num_doms(); <span class="comment">// 1 iff we prepended a mem var</span></div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i != n; ++i)</div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <a class="code hl_function" href="classmim_1_1Rewriter.html#a832644b4df14efed752cba8e8568aca4">map</a>(old_lam-><a class="code hl_function" href="classmim_1_1Def.html#a6e757a3ae8e52ee5b9ebdaea32c6abd8">var</a>(i), new_lam-><a class="code hl_function" href="classmim_1_1Def.html#a6e757a3ae8e52ee5b9ebdaea32c6abd8">var</a>(i + offset)-><a class="code hl_function" href="classmim_1_1Def.html#a1164a26b23818879edfa4e6b9fe41d97">set</a>(old_lam-><a class="code hl_function" href="classmim_1_1Def.html#a6e757a3ae8e52ee5b9ebdaea32c6abd8">var</a>(i)-><a class="code hl_function" href="classmim_1_1Def.html#aefa7b1a57b3a67d30070c9aa9d3b20b3">dbg</a>()));</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="comment">// A use of the whole parameter tuple is reconstructed from the new (shifted) components.</span></div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keywordflow">if</span> (n > 1)</div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <a class="code hl_function" href="classmim_1_1Rewriter.html#a832644b4df14efed752cba8e8568aca4">map</a>(old_lam-><a class="code hl_function" href="classmim_1_1Def.html#a6e757a3ae8e52ee5b9ebdaea32c6abd8">var</a>(), <a class="code hl_function" href="classmim_1_1RWPhase.html#a0f7249ac3c85d2f2b1d7c72455c61b19">new_world</a>().<a class="code hl_namespace" href="namespacemim_1_1plug_1_1tuple.html">tuple</a>(<a class="code hl_typedef" href="namespacemim.html#a1433b0566b2cbdbf0c6f74baed22bb52">DefVec</a>(n, [&](<span class="keywordtype">size_t</span> i) { <span class="keywordflow">return</span> new_lam->var(i + offset); })));</div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> }</div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> <span class="keywordflow">if</span> (!old_lam-><a class="code hl_function" href="classmim_1_1Def.html#a075f30462bdc7ae0e435c8e15cb48fff">is_set</a>()) <span class="keywordflow">return</span> new_lam;</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="comment">// The body's current memory is this lam's (leading or grouped) mem parameter - or none for direct-style fns.</span></div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> <span class="keyword">auto</span> save = std::exchange(curr_mem_, <a class="code hl_function" href="namespacemim_1_1plug_1_1mem.html#a2446c4ae7a339f03a420a00338ee8e3d">mem::mem_var</a>(new_lam));</div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> new_lam->set(<a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">rewrite</a>(old_lam-><a class="code hl_function" href="classmim_1_1Lam.html#a077994a2dbd8255456a1b9dbbdde4521">filter</a>()), <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">rewrite</a>(old_lam-><a class="code hl_function" href="classmim_1_1Lam.html#aca3affe9def9af98032c560f4f7a06ec">body</a>()));</div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> curr_mem_ = save;</div>
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="keywordflow">return</span> new_lam;</div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span>}</div>
</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
<div class="foldopen" id="foldopen00120" data-start="{" data-end="}">
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ac06a948bb271bf66158a2edbca0235e5"> 120</a></span><span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ac06a948bb271bf66158a2edbca0235e5">AddMem::rewrite_imm_App</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1App.html">App</a>* app) {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmim_1_1RWPhase.html#a8c1256f93cc63c1d8d0609e2aa474b51">is_bootstrapping</a>() || preserving_ || !curr_mem_) <span class="keywordflow">return</span> Rewriter::rewrite_imm_App(app);</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keyword">auto</span>& w = <a class="code hl_function" href="classmim_1_1RWPhase.html#a0f7249ac3c85d2f2b1d7c72455c61b19">new_world</a>();</div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="comment">// Rewrite the argument before the callee (as the base Rewriter does). This threads the current memory</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="comment">// through the argument's memory effects first; and because operands are rewritten before their users, a</span></div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> <span class="comment">// shared memory operation is anchored in the scope that consumes its result mem (its own scope) rather</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> <span class="comment">// than one that merely reuses its non-mem result. curr_mem_ then holds the memory *after* the argument.</span></div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keyword">auto</span> new_arg = <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">rewrite</a>(app-><a class="code hl_function" href="classmim_1_1App.html#adf118f16568ef138e33bdb1f330112d1">arg</a>());</div>
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <span class="keyword">auto</span> <a class="code hl_namespace" href="namespacemim_1_1plug_1_1mem.html">mem</a> = curr_mem_;</div>
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keyword">auto</span> new_callee = <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">rewrite</a>(app-><a class="code hl_function" href="classmim_1_1App.html#a9df7e6baae6a143ed3af2bc7ec643641">callee</a>());</div>
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> </div>
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> <span class="keyword">auto</span> old_pi = app-><a class="code hl_function" href="classmim_1_1App.html#a9df7e6baae6a143ed3af2bc7ec643641">callee</a>()-><a class="code hl_function" href="classmim_1_1Def.html#a9ab6cb5c35d630f631fd365cf7fa8f0c">type</a>()->isa<<a class="code hl_class" href="classmim_1_1Pi.html">Pi</a>>();</div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keyword">auto</span> new_pi = new_callee-><a class="code hl_function" href="classmim_1_1Def.html#a9ab6cb5c35d630f631fd365cf7fa8f0c">type</a>()->isa<<a class="code hl_class" href="classmim_1_1Pi.html">Pi</a>>();</div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <span class="keywordflow">if</span> (old_pi && new_pi && new_pi->num_doms() == old_pi->num_doms() + 1) {</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="comment">// The callee gained a leading mem parameter: splice the current memory in front of the arguments.</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> <span class="keyword">auto</span> n = old_pi->num_doms();</div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> <span class="keyword">auto</span> <a class="code hl_function" href="classmim_1_1Phase.html#ac444684ac23216a2b8e7dac0e3aad2ac">args</a> = <a class="code hl_typedef" href="namespacemim.html#a1433b0566b2cbdbf0c6f74baed22bb52">DefVec</a>(n + 1);</div>
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> <a class="code hl_function" href="classmim_1_1Phase.html#ac444684ac23216a2b8e7dac0e3aad2ac">args</a>[0] = <a class="code hl_namespace" href="namespacemim_1_1plug_1_1mem.html">mem</a>;</div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i != n; ++i)</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> <a class="code hl_function" href="classmim_1_1Phase.html#ac444684ac23216a2b8e7dac0e3aad2ac">args</a>[i + 1] = new_arg->proj(n, i);</div>
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span> new_arg = w.tuple(<a class="code hl_function" href="classmim_1_1Phase.html#ac444684ac23216a2b8e7dac0e3aad2ac">args</a>);</div>
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> }</div>
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span> </div>
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> <span class="keyword">auto</span> new_app = w.app(new_callee, new_arg);</div>
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span> advance_mem(new_app);</div>
<div class="line"><a id="l00146" name="l00146"></a><span class="lineno"> 146</span> <span class="keywordflow">return</span> new_app;</div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno"> 147</span>}</div>
</div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno"> 148</span> </div>
<div class="foldopen" id="foldopen00149" data-start="{" data-end="}">
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#a2c0100315071d36bb34765e3f6f7ff62"> 149</a></span><span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#a2c0100315071d36bb34765e3f6f7ff62">AddMem::rewrite_imm_Tuple</a>(<span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Tuple.html">Tuple</a>* <a class="code hl_namespace" href="namespacemim_1_1plug_1_1tuple.html">tuple</a>) {</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> <span class="keywordflow">if</span> (<a class="code hl_function" href="classmim_1_1RWPhase.html#a8c1256f93cc63c1d8d0609e2aa474b51">is_bootstrapping</a>() || preserving_ || !curr_mem_) <span class="keywordflow">return</span> Rewriter::rewrite_imm_Tuple(<a class="code hl_namespace" href="namespacemim_1_1plug_1_1tuple.html">tuple</a>);</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"> 152</span> <span class="comment">// The current memory must be threaded through the operands in the right order, because a memory operand</span></div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno"> 153</span> <span class="comment">// (which resolves to the *current* memory) is positioned freely relative to the operands that establish</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno"> 154</span> <span class="comment">// the real ordering. Rewrite in three groups:</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno"> 155</span> <span class="comment">// 1. plain values first - e.g. the `buf` of a buffer op's `(⊥ : %mem.M 0, buf)` argument, whose memory</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno"> 156</span> <span class="comment">// effects must precede the memory operand;</span></div>
<div class="line"><a id="l00157" name="l00157"></a><span class="lineno"> 157</span> <span class="comment">// 2. memory operands next - now resolving to the up-to-date current memory;</span></div>
<div class="line"><a id="l00158" name="l00158"></a><span class="lineno"> 158</span> <span class="comment">// 3. continuation values last - their bodies run later, so a shared memory operation they capture must</span></div>
<div class="line"><a id="l00159" name="l00159"></a><span class="lineno"> 159</span> <span class="comment">// already have been anchored (threaded) in this scope by the memory operands above.</span></div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"> 160</span> <span class="keyword">auto</span> rank = [](<span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* op) { <span class="keywordflow">return</span> <a class="code hl_function" href="namespacemim_1_1plug_1_1mem.html#ada840448f31c6d5165bd35848433793b">isa_mem</a>(op) ? 1 : (op->type() && <a class="code hl_function" href="classmim_1_1Pi.html#a60c2d05d18e618930742433ce71e0a61">Pi::isa_cn</a>(op->type()) ? 2 : 0); };</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00162" name="l00162"></a><span class="lineno"> 162</span> <span class="keyword">auto</span>& w = <a class="code hl_function" href="classmim_1_1RWPhase.html#a0f7249ac3c85d2f2b1d7c72455c61b19">new_world</a>();</div>
<div class="line"><a id="l00163" name="l00163"></a><span class="lineno"> 163</span> <span class="keyword">auto</span> n = <a class="code hl_namespace" href="namespacemim_1_1plug_1_1tuple.html">tuple</a>->num_ops();</div>
<div class="line"><a id="l00164" name="l00164"></a><span class="lineno"> 164</span> <span class="keyword">auto</span> new_ops = <a class="code hl_typedef" href="namespacemim.html#a1433b0566b2cbdbf0c6f74baed22bb52">DefVec</a>(n);</div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno"> 165</span> <span class="keywordflow">for</span> (<span class="keywordtype">int</span> r = 0; r != 3; ++r)</div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"> 166</span> <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i != n; ++i)</div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno"> 167</span> <span class="keywordflow">if</span> (rank(<a class="code hl_namespace" href="namespacemim_1_1plug_1_1tuple.html">tuple</a>->op(i)) == r) new_ops[i] = <a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">rewrite</a>(<a class="code hl_namespace" href="namespacemim_1_1plug_1_1tuple.html">tuple</a>->op(i));</div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"> 168</span> <span class="keywordflow">return</span> w.tuple(<a class="code hl_function" href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">rewrite</a>(<a class="code hl_namespace" href="namespacemim_1_1plug_1_1tuple.html">tuple</a>->type()), new_ops);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span>}</div>
</div>
<div class="line"><a id="l00170" name="l00170"></a><span class="lineno"> 170</span> </div>
<div class="line"><a id="l00171" name="l00171"></a><span class="lineno"> 171</span><span class="keywordtype">void</span> AddMem::advance_mem(<span class="keyword">const</span> <a class="code hl_class" href="classmim_1_1Def.html">Def</a>* def) {</div>
<div class="line"><a id="l00172" name="l00172"></a><span class="lineno"> 172</span> <span class="keywordflow">if</span> (<span class="keyword">auto</span> m = <a class="code hl_function" href="namespacemim_1_1plug_1_1mem.html#a4260bcf4de298db4a63520dc98c0d4e2">mem_def</a>(def)) curr_mem_ = m;</div>
<div class="line"><a id="l00173" name="l00173"></a><span class="lineno"> 173</span>}</div>
<div class="line"><a id="l00174" name="l00174"></a><span class="lineno"> 174</span> </div>
<div class="line"><a id="l00175" name="l00175"></a><span class="lineno"> 175</span>} <span class="comment">// namespace mim::plug::mem::phase</span></div>
<div class="ttc" id="aadd__mem_8h_html"><div class="ttname"><a href="add__mem_8h.html">add_mem.h</a></div></div>
<div class="ttc" id="aclassmim_1_1App_html"><div class="ttname"><a href="classmim_1_1App.html">mim::App</a></div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00224">lam.h:224</a></div></div>
<div class="ttc" id="aclassmim_1_1App_html_a29ef71935ad4ef6bdf94419a406aaa3b"><div class="ttname"><a href="classmim_1_1App.html#a29ef71935ad4ef6bdf94419a406aaa3b">mim::App::axm</a></div><div class="ttdeci">const Axm * axm() const</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00291">lam.h:291</a></div></div>
<div class="ttc" id="aclassmim_1_1App_html_a9df7e6baae6a143ed3af2bc7ec643641"><div class="ttname"><a href="classmim_1_1App.html#a9df7e6baae6a143ed3af2bc7ec643641">mim::App::callee</a></div><div class="ttdeci">const Def * callee() const</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00276">lam.h:276</a></div></div>
<div class="ttc" id="aclassmim_1_1App_html_adf118f16568ef138e33bdb1f330112d1"><div class="ttname"><a href="classmim_1_1App.html#adf118f16568ef138e33bdb1f330112d1">mim::App::arg</a></div><div class="ttdeci">const Def * arg() const</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00285">lam.h:285</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html"><div class="ttname"><a href="classmim_1_1Def.html">mim::Def</a></div><div class="ttdoc">Base class for all Defs.</div><div class="ttdef"><b>Definition</b> <a href="def_8h_source.html#l00258">def.h:258</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_a075f30462bdc7ae0e435c8e15cb48fff"><div class="ttname"><a href="classmim_1_1Def.html#a075f30462bdc7ae0e435c8e15cb48fff">mim::Def::is_set</a></div><div class="ttdeci">bool is_set() const</div><div class="ttdoc">Yields true if empty or the last op is set.</div><div class="ttdef"><b>Definition</b> <a href="def_8cpp_source.html#l00308">def.cpp:308</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_a1164a26b23818879edfa4e6b9fe41d97"><div class="ttname"><a href="classmim_1_1Def.html#a1164a26b23818879edfa4e6b9fe41d97">mim::Def::set</a></div><div class="ttdeci">Def * set(size_t i, const Def *)</div><div class="ttdoc">Successively set from left to right.</div><div class="ttdef"><b>Definition</b> <a href="def_8cpp_source.html#l00276">def.cpp:276</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_a53a70702795d9c4bafe6de0d4f4a66f1"><div class="ttname"><a href="classmim_1_1Def.html#a53a70702795d9c4bafe6de0d4f4a66f1">mim::Def::isa_mut</a></div><div class="ttdeci">T * isa_mut() const</div><div class="ttdoc">If this is mutable, it will cast constness away and perform a dynamic_cast to T.</div><div class="ttdef"><b>Definition</b> <a href="def_8h_source.html#l00521">def.h:521</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_a6e757a3ae8e52ee5b9ebdaea32c6abd8"><div class="ttname"><a href="classmim_1_1Def.html#a6e757a3ae8e52ee5b9ebdaea32c6abd8">mim::Def::var</a></div><div class="ttdeci">const Def * var(nat_t a, nat_t i) noexcept</div><div class="ttdef"><b>Definition</b> <a href="def_8h_source.html#l00438">def.h:438</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_a84ee4f56868a620ccf508d9044212fad"><div class="ttname"><a href="classmim_1_1Def.html#a84ee4f56868a620ccf508d9044212fad">mim::Def::num_vars</a></div><div class="ttdeci">nat_t num_vars() noexcept</div><div class="ttdef"><b>Definition</b> <a href="def_8h_source.html#l00438">def.h:438</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_a9ab6cb5c35d630f631fd365cf7fa8f0c"><div class="ttname"><a href="classmim_1_1Def.html#a9ab6cb5c35d630f631fd365cf7fa8f0c">mim::Def::type</a></div><div class="ttdeci">const Def * type() const noexcept</div><div class="ttdoc">Yields the "raw" type of this Def (maybe nullptr).</div><div class="ttdef"><b>Definition</b> <a href="def_8cpp_source.html#l00491">def.cpp:491</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_aefa7b1a57b3a67d30070c9aa9d3b20b3"><div class="ttname"><a href="classmim_1_1Def.html#aefa7b1a57b3a67d30070c9aa9d3b20b3">mim::Def::dbg</a></div><div class="ttdeci">Dbg dbg() const</div><div class="ttdef"><b>Definition</b> <a href="def_8h_source.html#l00541">def.h:541</a></div></div>
<div class="ttc" id="aclassmim_1_1Def_html_af82f20111e9f1cbdbf910d30341bd4ee"><div class="ttname"><a href="classmim_1_1Def.html#af82f20111e9f1cbdbf910d30341bd4ee">mim::Def::has_var</a></div><div class="ttdeci">const Var * has_var()</div><div class="ttdoc">Only returns not nullptr, if Var of this mutable has ever been created.</div><div class="ttdef"><b>Definition</b> <a href="def_8h_source.html#l00442">def.h:442</a></div></div>
<div class="ttc" id="aclassmim_1_1Lam_html"><div class="ttname"><a href="classmim_1_1Lam.html">mim::Lam</a></div><div class="ttdoc">A function.</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00110">lam.h:110</a></div></div>
<div class="ttc" id="aclassmim_1_1Lam_html_a077994a2dbd8255456a1b9dbbdde4521"><div class="ttname"><a href="classmim_1_1Lam.html#a077994a2dbd8255456a1b9dbbdde4521">mim::Lam::filter</a></div><div class="ttdeci">const Def * filter() const</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00122">lam.h:122</a></div></div>
<div class="ttc" id="aclassmim_1_1Lam_html_a24231a9b2503394cd8a54128a043db1b"><div class="ttname"><a href="classmim_1_1Lam.html#a24231a9b2503394cd8a54128a043db1b">mim::Lam::set</a></div><div class="ttdeci">Lam * set(Filter filter, const Def *body)</div><div class="ttdef"><b>Definition</b> <a href="lam_8cpp_source.html#l00029">lam.cpp:29</a></div></div>
<div class="ttc" id="aclassmim_1_1Lam_html_a6380ad84433a405f9e2a7695ecffa6b3"><div class="ttname"><a href="classmim_1_1Lam.html#a6380ad84433a405f9e2a7695ecffa6b3">mim::Lam::type</a></div><div class="ttdeci">const Pi * type() const</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00130">lam.h:130</a></div></div>
<div class="ttc" id="aclassmim_1_1Lam_html_aca3affe9def9af98032c560f4f7a06ec"><div class="ttname"><a href="classmim_1_1Lam.html#aca3affe9def9af98032c560f4f7a06ec">mim::Lam::body</a></div><div class="ttdeci">const Def * body() const</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00123">lam.h:123</a></div></div>
<div class="ttc" id="aclassmim_1_1Phase_html_ac444684ac23216a2b8e7dac0e3aad2ac"><div class="ttname"><a href="classmim_1_1Phase.html#ac444684ac23216a2b8e7dac0e3aad2ac">mim::Phase::args</a></div><div class="ttdeci">const Vector< std::string > & args()</div><div class="ttdoc">Command-line arguments passed to this Phase's plugin via -X <plugin>:<arg>.</div><div class="ttdef"><b>Definition</b> <a href="phase_8cpp_source.html#l00023">phase.cpp:23</a></div></div>
<div class="ttc" id="aclassmim_1_1Pi_html"><div class="ttname"><a href="classmim_1_1Pi.html">mim::Pi</a></div><div class="ttdoc">A dependent function type.</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00014">lam.h:14</a></div></div>
<div class="ttc" id="aclassmim_1_1Pi_html_a60c2d05d18e618930742433ce71e0a61"><div class="ttname"><a href="classmim_1_1Pi.html#a60c2d05d18e618930742433ce71e0a61">mim::Pi::isa_cn</a></div><div class="ttdeci">static const Pi * isa_cn(const Def *d)</div><div class="ttdoc">Is this a continuation - i.e. is the Pi::codom mim::Bottom?</div><div class="ttdef"><b>Definition</b> <a href="lam_8h_source.html#l00047">lam.h:47</a></div></div>
<div class="ttc" id="aclassmim_1_1RWPhase_html_a0f7249ac3c85d2f2b1d7c72455c61b19"><div class="ttname"><a href="classmim_1_1RWPhase.html#a0f7249ac3c85d2f2b1d7c72455c61b19">mim::RWPhase::new_world</a></div><div class="ttdeci">World & new_world()</div><div class="ttdoc">Create new Defs into this.</div><div class="ttdef"><b>Definition</b> <a href="phase_8h_source.html#l00368">phase.h:368</a></div></div>
<div class="ttc" id="aclassmim_1_1RWPhase_html_a8c1256f93cc63c1d8d0609e2aa474b51"><div class="ttname"><a href="classmim_1_1RWPhase.html#a8c1256f93cc63c1d8d0609e2aa474b51">mim::RWPhase::is_bootstrapping</a></div><div class="ttdeci">bool is_bootstrapping() const</div><div class="ttdoc">Returns whether we are currently bootstrapping (rewriting annexes).</div><div class="ttdef"><b>Definition</b> <a href="phase_8h_source.html#l00356">phase.h:356</a></div></div>
<div class="ttc" id="aclassmim_1_1RWPhase_html_a8f18849b836d888382aed5b2bcc249f8"><div class="ttname"><a href="classmim_1_1RWPhase.html#a8f18849b836d888382aed5b2bcc249f8">mim::RWPhase::start</a></div><div class="ttdeci">void start() override</div><div class="ttdoc">Actual entry.</div><div class="ttdef"><b>Definition</b> <a href="phase_8cpp_source.html#l00128">phase.cpp:128</a></div></div>
<div class="ttc" id="aclassmim_1_1RWPhase_html_aef58721bd5f8d89e624eea65ff51f6b3"><div class="ttname"><a href="classmim_1_1RWPhase.html#aef58721bd5f8d89e624eea65ff51f6b3">mim::RWPhase::old_world</a></div><div class="ttdeci">World & old_world()</div><div class="ttdoc">Get old Defs from here.</div><div class="ttdef"><b>Definition</b> <a href="phase_8h_source.html#l00367">phase.h:367</a></div></div>
<div class="ttc" id="aclassmim_1_1Rewriter_html_a832644b4df14efed752cba8e8568aca4"><div class="ttname"><a href="classmim_1_1Rewriter.html#a832644b4df14efed752cba8e8568aca4">mim::Rewriter::map</a></div><div class="ttdeci">virtual const Def * map(const Def *old_def, const Def *new_def)</div><div class="ttdef"><b>Definition</b> <a href="rewrite_8h_source.html#l00045">rewrite.h:45</a></div></div>
<div class="ttc" id="aclassmim_1_1Rewriter_html_acd9201feaab8a6d73223308e48ff6652"><div class="ttname"><a href="classmim_1_1Rewriter.html#acd9201feaab8a6d73223308e48ff6652">mim::Rewriter::rewrite</a></div><div class="ttdeci">virtual const Def * rewrite(const Def *)</div><div class="ttdef"><b>Definition</b> <a href="rewrite_8cpp_source.html#l00056">rewrite.cpp:56</a></div></div>
<div class="ttc" id="aclassmim_1_1Sigma_html"><div class="ttname"><a href="classmim_1_1Sigma.html">mim::Sigma</a></div><div class="ttdoc">A dependent tuple type.</div><div class="ttdef"><b>Definition</b> <a href="tuple_8h_source.html#l00022">tuple.h:22</a></div></div>
<div class="ttc" id="aclassmim_1_1Tuple_html"><div class="ttname"><a href="classmim_1_1Tuple.html">mim::Tuple</a></div><div class="ttdoc">Data constructor for a Sigma.</div><div class="ttdef"><b>Definition</b> <a href="tuple_8h_source.html#l00070">tuple.h:70</a></div></div>
<div class="ttc" id="aclassmim_1_1VarRewriter_html"><div class="ttname"><a href="classmim_1_1VarRewriter.html">mim::VarRewriter</a></div><div class="ttdoc">Extends Rewriter for variable substitution.</div><div class="ttdef"><b>Definition</b> <a href="rewrite_8h_source.html#l00122">rewrite.h:122</a></div></div>
<div class="ttc" id="aclassmim_1_1World_html_afa7919f0e7f69f2451aedd9da912c857"><div class="ttname"><a href="classmim_1_1World.html#afa7919f0e7f69f2451aedd9da912c857">mim::World::mut_lam</a></div><div class="ttdeci">Lam * mut_lam(const Pi *pi)</div><div class="ttdef"><b>Definition</b> <a href="world_8h_source.html#l00406">world.h:406</a></div></div>
<div class="ttc" id="aclassmim_1_1plug_1_1mem_1_1phase_1_1AddMem_html_a2c0100315071d36bb34765e3f6f7ff62"><div class="ttname"><a href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#a2c0100315071d36bb34765e3f6f7ff62">mim::plug::mem::phase::AddMem::rewrite_imm_Tuple</a></div><div class="ttdeci">const Def * rewrite_imm_Tuple(const Tuple *) override</div><div class="ttdef"><b>Definition</b> <a href="#l00149">add_mem.cpp:149</a></div></div>
<div class="ttc" id="aclassmim_1_1plug_1_1mem_1_1phase_1_1AddMem_html_a4c007a711229208593f254b527d0190f"><div class="ttname"><a href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#a4c007a711229208593f254b527d0190f">mim::plug::mem::phase::AddMem::rewrite_imm_Pi</a></div><div class="ttdeci">const Def * rewrite_imm_Pi(const Pi *) override</div><div class="ttdef"><b>Definition</b> <a href="#l00049">add_mem.cpp:49</a></div></div>
<div class="ttc" id="aclassmim_1_1plug_1_1mem_1_1phase_1_1AddMem_html_ab56796994e4017f617ff0e6f52d53886"><div class="ttname"><a href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ab56796994e4017f617ff0e6f52d53886">mim::plug::mem::phase::AddMem::rewrite</a></div><div class="ttdeci">const Def * rewrite(const Def *) override</div><div class="ttdef"><b>Definition</b> <a href="#l00039">add_mem.cpp:39</a></div></div>
<div class="ttc" id="aclassmim_1_1plug_1_1mem_1_1phase_1_1AddMem_html_abad7748a99cb8b1f0db81db03afb417c"><div class="ttname"><a href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#abad7748a99cb8b1f0db81db03afb417c">mim::plug::mem::phase::AddMem::rewrite_mut_Lam</a></div><div class="ttdeci">const Def * rewrite_mut_Lam(Lam *) override</div><div class="ttdef"><b>Definition</b> <a href="#l00087">add_mem.cpp:87</a></div></div>
<div class="ttc" id="aclassmim_1_1plug_1_1mem_1_1phase_1_1AddMem_html_ac06a948bb271bf66158a2edbca0235e5"><div class="ttname"><a href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ac06a948bb271bf66158a2edbca0235e5">mim::plug::mem::phase::AddMem::rewrite_imm_App</a></div><div class="ttdeci">const Def * rewrite_imm_App(const App *) override</div><div class="ttdef"><b>Definition</b> <a href="#l00120">add_mem.cpp:120</a></div></div>
<div class="ttc" id="aclassmim_1_1plug_1_1mem_1_1phase_1_1AddMem_html_ae89382deb0efbc5696abfa447c5b7993"><div class="ttname"><a href="classmim_1_1plug_1_1mem_1_1phase_1_1AddMem.html#ae89382deb0efbc5696abfa447c5b7993">mim::plug::mem::phase::AddMem::start</a></div><div class="ttdeci">void start() override</div><div class="ttdoc">Actual entry.</div><div class="ttdef"><b>Definition</b> <a href="#l00013">add_mem.cpp:13</a></div></div>
<div class="ttc" id="aclassmim_1_1unique__queue_html"><div class="ttname"><a href="classmim_1_1unique__queue.html">mim::unique_queue</a></div><div class="ttdef"><b>Definition</b> <a href="util_8h_source.html#l00125">util.h:125</a></div></div>
<div class="ttc" id="aclassmim_1_1unique__queue_html_a1d2b139e34bfc51d1cd42c7fb1244fd8"><div class="ttname"><a href="classmim_1_1unique__queue.html#a1d2b139e34bfc51d1cd42c7fb1244fd8">mim::unique_queue::empty</a></div><div class="ttdeci">bool empty() const</div><div class="ttdef"><b>Definition</b> <a href="util_8h_source.html#l00141">util.h:141</a></div></div>
<div class="ttc" id="aclassmim_1_1unique__queue_html_a2e9f9f38db1723c6a77fe4f75a6efdb6"><div class="ttname"><a href="classmim_1_1unique__queue.html#a2e9f9f38db1723c6a77fe4f75a6efdb6">mim::unique_queue::pop</a></div><div class="ttdeci">T pop()</div><div class="ttdef"><b>Definition</b> <a href="util_8h_source.html#l00142">util.h:142</a></div></div>
<div class="ttc" id="aclassmim_1_1unique__queue_html_ad2d075da9d644427c35f019ca2b5bb9e"><div class="ttname"><a href="classmim_1_1unique__queue.html#ad2d075da9d644427c35f019ca2b5bb9e">mim::unique_queue::push</a></div><div class="ttdeci">bool push(T val)</div><div class="ttdef"><b>Definition</b> <a href="util_8h_source.html#l00133">util.h:133</a></div></div>
<div class="ttc" id="amem_8h_html"><div class="ttname"><a href="mem_8h.html">mem.h</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1mem_1_1phase_html"><div class="ttname"><a href="namespacemim_1_1plug_1_1mem_1_1phase.html">mim::plug::mem::phase</a></div><div class="ttdef"><b>Definition</b> <a href="add__mem_8h_source.html#l00005">add_mem.h:5</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1mem_html"><div class="ttname"><a href="namespacemim_1_1plug_1_1mem.html">mim::plug::mem</a></div><div class="ttdoc">The mem Plugin</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00011">mem.h:11</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1mem_html_a0b3a4f02c49f44380ce8b9e83a5affc5"><div class="ttname"><a href="namespacemim_1_1plug_1_1mem.html#a0b3a4f02c49f44380ce8b9e83a5affc5">mim::plug::mem::has_leading_mem</a></div><div class="ttdeci">bool has_leading_mem(const Pi *pi)</div><div class="ttdoc">Does pi already thread memory - a leading mem.M, either directly or grouped as the first component of...</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00033">mem.h:33</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1mem_html_a2446c4ae7a339f03a420a00338ee8e3d"><div class="ttname"><a href="namespacemim_1_1plug_1_1mem.html#a2446c4ae7a339f03a420a00338ee8e3d">mim::plug::mem::mem_var</a></div><div class="ttdeci">const Def * mem_var(Lam *lam)</div><div class="ttdoc">Returns the memory argument of a function if it has one.</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00055">mem.h:55</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1mem_html_a4260bcf4de298db4a63520dc98c0d4e2"><div class="ttname"><a href="namespacemim_1_1plug_1_1mem.html#a4260bcf4de298db4a63520dc98c0d4e2">mim::plug::mem::mem_def</a></div><div class="ttdeci">const Def * mem_def(const Def *def)</div><div class="ttdoc">Returns the (first) element of type mem.M a from the given tuple.</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00042">mem.h:42</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1mem_html_a44127c99fa94a5143565463d65206ea6"><div class="ttname"><a href="namespacemim_1_1plug_1_1mem.html#a44127c99fa94a5143565463d65206ea6">mim::plug::mem::M</a></div><div class="ttdeci">M</div><div class="ttdef"><b>Definition</b> <a href="mem_2autogen_8h_source.html#l00014">autogen.h:14</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1mem_html_ada840448f31c6d5165bd35848433793b"><div class="ttname"><a href="namespacemim_1_1plug_1_1mem.html#ada840448f31c6d5165bd35848433793b">mim::plug::mem::isa_mem</a></div><div class="ttdeci">const App * isa_mem(const Def *def)</div><div class="ttdoc">If def is a mem.M-typed value, yields its memory type mem.M a; otherwise nullptr.</div><div class="ttdef"><b>Definition</b> <a href="mem_8h_source.html#l00026">mem.h:26</a></div></div>
<div class="ttc" id="anamespacemim_1_1plug_1_1tuple_html"><div class="ttname"><a href="namespacemim_1_1plug_1_1tuple.html">mim::plug::tuple</a></div><div class="ttdoc">The tuple Plugin</div><div class="ttdef"><b>Definition</b> <a href="tuple_2normalizers_8cpp_source.html#l00006">normalizers.cpp:6</a></div></div>
<div class="ttc" id="anamespacemim_html_a1433b0566b2cbdbf0c6f74baed22bb52"><div class="ttname"><a href="namespacemim.html#a1433b0566b2cbdbf0c6f74baed22bb52">mim::DefVec</a></div><div class="ttdeci">Vector< const Def * > DefVec</div><div class="ttdef"><b>Definition</b> <a href="def_8h_source.html#l00079">def.h:79</a></div></div>
<div class="ttc" id="autil_8h_html"><div class="ttname"><a href="util_8h.html">util.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
</div><!-- container -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a href="dir_3f6d0e947440f9d0b42426d30577ffdc.html">mim</a></li><li class="navelem"><a href="dir_07110a8747d2517ee97007224f1d2994.html">plug</a></li><li class="navelem"><a href="dir_a8769299ba688646b3b09d59765dd001.html">mem</a></li><li class="navelem"><a href="dir_2281a8ca2902267c90b03110a95e76a2.html">phase</a></li><li class="navelem"><a href="add__mem_8cpp.html">add_mem.cpp</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.16.1 </li>
</ul>
</div>
</body>
</html>