MimIR
0.4-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
branch_normalize.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
mim/phase.h
"
4
5
namespace
mim
{
6
7
/// Normalizes branches: η-expands non-Lam branch targets so that both sides of a `(f, t)#cond`
8
/// branch are Lam%s, as later phases and the backends expect.
9
class
BranchNormalize
:
public
RWPhase
{
10
public
:
11
BranchNormalize
(
World
&
world
,
flags_t
annex
)
12
:
RWPhase
(
world
,
annex
) {}
13
14
private
:
15
const
Def
* normalize(
const
Def
*);
16
const
Def
*
rewrite_mut_Lam
(
Lam
*)
final
;
17
18
DefSet
analyzed_;
19
LamMap<bool>
candidate_;
20
};
21
22
}
// namespace mim
mim::BranchNormalize::BranchNormalize
BranchNormalize(World &world, flags_t annex)
Definition
branch_normalize.h:11
mim::BranchNormalize::rewrite_mut_Lam
const Def * rewrite_mut_Lam(Lam *) final
Definition
branch_normalize.cpp:7
mim::Def
Base class for all Defs.
Definition
def.h:273
mim::Lam
A function.
Definition
lam.h:113
mim::Phase::annex
flags_t annex() const
Definition
phase.h:81
mim::RWPhase::RWPhase
RWPhase(World &world, std::string name, Analysis *analysis=nullptr)
Definition
phase.h:431
mim::RWPhase::world
World & world()=delete
Hides both and forbids direct access.
mim::World
The World represents the whole program and manages creation of MimIR nodes (Defs).
Definition
world.h:40
mim
Definition
ast.h:16
mim::flags_t
u64 flags_t
Definition
types.h:39
mim::LamMap
GIDMap< Lam *, To > LamMap
Definition
lam.h:219
mim::DefSet
GIDSet< const Def * > DefSet
Definition
def.h:89
phase.h
include
mim
phase
branch_normalize.h
Generated by
1.18.0