Namespaces | |
| namespace | phase |
Classes | |
| class | EscapeAnalysis |
| Determines which allocations stay within the scope that allocates them. More... | |
Typedefs | |
| using | M = plug::core::M |
| using | Ptr = plug::core::Ptr |
Enumerations | |
<tt>mem.Ptr0</tt> | |
| enum class | Ptr0 : flags_t |
<tt>mem.Char</tt> | |
| enum class | Char : flags_t |
<tt>mem.Str</tt> | |
| enum class | Str : flags_t |
<tt>mem.fresh</tt> | |
| enum class | fresh : flags_t |
<tt>mem.alloc</tt> | |
| enum class | alloc : flags_t |
<tt>mem.slot</tt> | |
| enum class | slot : flags_t |
<tt>mem.malloc</tt> | |
| enum class | malloc : flags_t |
<tt>mem.free</tt> | |
| enum class | free : flags_t |
<tt>mem.mslot</tt> | |
| enum class | mslot : flags_t |
<tt>mem.decay</tt> | |
| enum class | decay : flags_t |
<tt>mem.assume</tt> | |
| enum class | assume : flags_t |
<tt>mem.cstr</tt> | |
| enum class | cstr : flags_t |
<tt>mem.add_mem</tt> | |
| enum class | add_mem : flags_t |
<tt>mem.free_locals</tt> | |
| enum class | free_locals : flags_t |
<tt>mem.heap2stack</tt> | |
| enum class | heap2stack : flags_t |
<tt>mem.seo</tt> | |
| enum class | seo : flags_t |
<tt>mem.alloc2malloc_repl</tt> | |
| enum class | alloc2malloc_repl : flags_t |
Functions | |
| void | register_normalizers (Normalizers &normalizers) |
mem.M | |
| Lam * | mut_con (World &w, nat_t a=0) |
| Yields con[mem.M 0]. | |
| Lam * | mut_con (const Def *dom) |
| Yields con[mem.M 0, dom]. | |
| const App * | isa_mem (const Def *def) |
If def is a mem.M-typed value, yields its memory type mem.M a; otherwise nullptr. | |
| bool | has_leading_mem (const Pi *pi) |
Does pi already thread memory - a leading mem.M, either directly or grouped as the first component of the first parameter (e.g. | |
| const Def * | mem_def (const Def *def) |
| Returns the (first) element of type mem.M a from the given tuple. | |
| const Def * | mem_var (Lam *lam) |
| Returns the memory argument of a function if it has one. | |
| bool | has_mem_ty (const Def *type) |
Is type mem.M or a Sigma with a mem.M component? | |
| const Def * | strip_mem_ty (const Def *def) |
| Removes recusively all occurences of mem from a type (sigma). | |
mem.Ptr | |
| const Def * | pointee (const Def *ptr) |
mem.lea | |
| const Def * | op_lea (const Def *ptr, const Def *index) |
| const Def * | op_lea_tuple (const Def *ptr, const Def *tuple) |
Successively offsets ptr by each component of the index tuple, peeling one array dimension per mem.lea. | |
mem.alloc | |
| const Def * | op_alloc (const Def *type, const Def *as, const Def *mem) |
| const Def * | op_alloc (const Def *type, const Def *mem) |
mem.slot | |
| const Def * | op_slot (const Def *type, const Def *as, const Def *mem, const Def *ret) |
| std::tuple< const Def *, Lam *, const Def *, const Def * > | split_slot (const App *slotslot) |
Decomposes the continuation-based slot into (mem, ret_lam, ret_mem, ptr), where ret_mem is the continuation's mem and ptr is the continuation's slot var; the slot's lifetime is ret_lam's scope. | |
mem.malloc | |
| const Def * | op_malloc (const Def *type, const Def *as, const Def *mem) |
mem.mslot | |
| const Def * | op_mslot (const Def *type, const Def *as, const Def *mem, const Def *ret) |
Variables | |
| static constexpr plugin_t | Plugin_Id = 0x3863800000000000 |
<tt>mem.load</tt> | |
| enum class | load : flags_t |
| const Def * | normalize_load (const Def *type, const Def *, const Def *arg) |
<tt>mem.store</tt> | |
| enum class | store : flags_t |
| const Def * | normalize_store (const Def *, const Def *, const Def *arg) |
<tt>mem.lea</tt> | |
| enum class | lea : flags_t |
| const Def * | normalize_lea (const Def *, const Def *, const Def *arg) |
| using mim::plug::mem::M = plug::core::M |
| using mim::plug::mem::Ptr = plug::core::Ptr |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
|
inline |
Does pi already thread memory - a leading mem.M, either directly or grouped as the first component of the first parameter (e.g.
the Fn [mem.M 0, To, ins] → … shape of a mem-threaded combiner)?
Definition at line 29 of file mem.h.
References mim::Pi::dom(), has_leading_mem(), mim::Axm::isa(), mim::Pi::num_doms(), and mim::Def::num_ops().
Referenced by has_leading_mem(), and mim::plug::mem::phase::AddMem::rewrite_imm_Pi().
|
inline |
Is type mem.M or a Sigma with a mem.M component?
Definition at line 54 of file mem.h.
References has_mem_ty(), and mim::Axm::isa().
Referenced by has_mem_ty().
If def is a mem.M-typed value, yields its memory type mem.M a; otherwise nullptr.
Definition at line 25 of file mem.h.
References mim::Axm::isa(), isa_mem(), and mim::Def::type().
Referenced by isa_mem(), mem_def(), mim::plug::mem::phase::AddMem::rewrite(), and mim::plug::mem::phase::AddMem::rewrite_imm_Tuple().
Returns the (first) element of type mem.M a from the given tuple.
Definition at line 38 of file mem.h.
References isa_mem(), mem_def(), mim::Def::num_projs(), mim::Def::projs(), and mim::Def::type().
Referenced by mem_def(), mem_var(), mim::plug::mem::EscapeAnalysis::rewrite_imm(), mim::plug::affine::phase::LowerFor::rewrite_imm_App(), and mim::plug::mem::phase::FreeLocals::rewrite_imm_App().
Returns the memory argument of a function if it has one.
Definition at line 51 of file mem.h.
References mem_def(), mem_var(), and mim::Def::var().
Referenced by mem_var(), mim::plug::affine::phase::LowerFor::rewrite_imm_App(), and mim::plug::mem::phase::AddMem::rewrite_mut_Lam().
Yields con[mem.M 0, dom].
Definition at line 19 of file mem.h.
References mut_con(), and mim::Def::world().
Definition at line 7 of file normalizers.cpp.
References mim::Lit::isa(), normalize_lea(), pointee(), and mim::Def::projs().
Referenced by normalize_lea().
Definition at line 14 of file normalizers.cpp.
References normalize_load(), mim::Def::num_ops(), mim::Def::op(), pointee(), and mim::Def::projs().
Referenced by normalize_load().
Definition at line 28 of file normalizers.cpp.
References mim::Seq::body(), normalize_store(), and mim::Def::projs().
Referenced by normalize_store().
Definition at line 108 of file mem.h.
References op_alloc().
Referenced by op_alloc(), op_alloc(), mim::plug::clos::phase::LowerTypedClos::rewrite(), and mim::plug::buffer::LowerPtr::rewrite_imm_App().
Definition at line 112 of file mem.h.
References op_alloc().
Definition at line 89 of file mem.h.
References mim::Axm::as(), op_lea(), pointee(), mim::tuple_of_types(), mim::Def::type(), and mim::Def::world().
Referenced by op_lea(), and op_lea_tuple().
Successively offsets ptr by each component of the index tuple, peeling one array dimension per mem.lea.
Definition at line 97 of file mem.h.
References op_lea(), and op_lea_tuple().
Referenced by op_lea_tuple(), and mim::plug::buffer::LowerPtr::rewrite_imm_App().
Definition at line 137 of file mem.h.
References op_malloc(), and mim::plug::core::size.
Referenced by op_malloc(), and reg_phases().
|
inline |
Builds the continuation-based mem.mslot (type, as) applied to (mem, size) and the continuation ret. ret is a Cn [mem.M as, mem.Ptr (type, as)] receiving the fresh slot; its scope delimits the slot's lifetime.
Definition at line 148 of file mem.h.
References op_mslot(), and mim::plug::core::size.
Referenced by op_mslot(), and reg_phases().
|
inline |
Builds the continuation-based mem.slot (type, as) applied to mem and the continuation ret. ret is a Cn [mem.M as, mem.Ptr (type, as)] receiving the fresh slot; its scope delimits the slot's lifetime.
Definition at line 119 of file mem.h.
References op_slot().
Referenced by op_slot(), mim::plug::mem::phase::Heap2Stack::rewrite_imm_App(), and mim::plug::mem::phase::SEO::rewrite_imm_App().
Definition at line 81 of file mem.h.
References mim::Axm::as(), pointee(), and mim::Def::type().
Referenced by mim::plug::mem::phase::Heap2Stack::analyze(), mim::plug::mem::phase::mk_phi(), normalize_lea(), normalize_load(), op_lea(), pointee(), mim::plug::mem::phase::Heap2Stack::rewrite_imm_App(), and mim::plug::mem::phase::sloxy_path().
| void mim::plug::mem::register_normalizers | ( | Normalizers & | normalizers | ) |
References register_normalizers().
Referenced by MIM_PLUGIN_ENTRY(), and register_normalizers().
|
inline |
Decomposes the continuation-based slot into (mem, ret_lam, ret_mem, ptr), where ret_mem is the continuation's mem and ptr is the continuation's slot var; the slot's lifetime is ret_lam's scope.
All but mem are nullptr if the continuation is no mutable Lam.
Definition at line 127 of file mem.h.
References split_slot().
Referenced by mim::plug::mem::phase::SEO::rewrite_imm_App(), and split_slot().
Removes recusively all occurences of mem from a type (sigma).
Definition at line 62 of file mem.h.
References mim::Axm::isa(), strip_mem_ty(), and mim::Def::world().
Referenced by mim::plug::ll::Emitter::convert_ret_pi(), and strip_mem_ty().