MimIR
0.6-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
sink_args.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
mim/phase.h
>
4
#include <
mim/tuple.h
>
5
6
namespace
mim::plug::mem::phase
{
7
8
/// Lets every Dispatch pass nothing but memory.
9
/// After mim::EtaConv, a Lam in a Dispatch occurs nowhere else, so it takes only the memory and the rest directly.
10
/// Any other target becomes a wrapper that takes the memory `m` and jumps to it with `m` and the other arguments.
11
/// A Dispatch without memory passes `()` until mem::phase::AddMem gives each target a `mem.M`.
12
/// A wrapper passes more than memory, so it is no η-redex and stays stable next to mim::EtaConv.
13
/// mim::DispatchNormalize η-expands the remaining non-Lam targets later.
14
class
SinkArgs
:
public
RWPhase
{
15
public
:
16
using
RWPhase::RWPhase
;
17
18
private
:
19
std::array<const Def*, 2>
rewrite_filter_body
(
Lam
*,
Lam
*)
final
;
20
const
Def
* sink(
const
Dispatch
&,
const
Sieve
&);
21
};
22
23
}
// namespace mim::plug::mem::phase
mim::Def
Base class for all Defs.
Definition
def.h:285
mim::Dispatch
Matches (target_0, target_1, ...)#index arg.
Definition
tuple.h:467
mim::Lam
A function.
Definition
lam.h:91
mim::RWPhase::RWPhase
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition
phase.h:360
mim::Sieve
Filters the components of an aggregate and keeps track of where the survivors end up.
Definition
tuple.h:116
mim::plug::mem::phase::SinkArgs
Lets every Dispatch pass nothing but memory.
Definition
sink_args.h:14
mim::plug::mem::phase::SinkArgs::rewrite_filter_body
std::array< const Def *, 2 > rewrite_filter_body(Lam *, Lam *) final
The rewritten filter and body of old_lam for its stub new_lam, before the body is coerce()d.
Definition
sink_args.cpp:9
mim::plug::mem::phase::SinkArgs::RWPhase
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition
phase.h:360
mim::plug::mem::phase
Definition
add_mem.h:6
phase.h
tuple.h
include
mim
plug
mem
phase
sink_args.h
Generated by
1.18.0