MimIR
0.1
MimIR is my Intermediate Representation
Toggle main menu visibility
Main Page
Documentation
Mim Command-Line Reference
Mim Language Reference
Coding & Debugging
Developer Guide
Passes
Plugins
affine
autodiff
clos
compile
core
demo
direct
math
matrix
mem
opt
ord
refly
regex
tensor
tuple
vec
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
z
Functions
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
z
Variables
Typedefs
a
b
d
f
g
j
l
m
n
p
r
s
t
u
v
w
Enumerations
a
b
c
d
e
f
g
i
j
l
m
n
p
q
r
s
t
v
w
z
Concepts
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
z
~
Variables
a
b
c
d
f
g
i
l
m
n
o
p
r
s
t
w
Typedefs
Enumerations
Enumerator
Related Symbols
a
b
c
f
i
l
n
o
p
s
w
Files
File List
File Members
All
a
c
d
e
g
h
i
m
r
v
w
Functions
Typedefs
Macros
a
c
d
e
g
h
i
m
v
w
▼
MimIR
►
Introduction
►
Documentation
►
Plugins
►
Namespaces
►
Concepts
►
Classes
▼
Files
▼
File List
►
build
docs
▼
include
►
automaton
▼
mim
►
ast
►
be
▼
pass
►
beta_red.h
►
eta_exp.h
►
eta_red.h
►
lam_spec.h
►
optimize.h
►
pass.h
►
pipelinebuilder.h
►
ret_wrap.h
►
scalarize.h
►
tail_rec_elim.h
►
phase
►
plug
►
util
►
axm.h
►
check.h
►
def.h
►
driver.h
►
flags.h
►
lam.h
►
lattice.h
►
nest.h
►
normalize.h
►
plugin.h
►
rewrite.h
►
schedule.h
►
tuple.h
►
world.h
►
src
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Concepts
Loading...
Searching...
No Matches
beta_red.h
Go to the documentation of this file.
1
#pragma once
2
3
#include "
mim/pass/pass.h
"
4
5
namespace
mim
{
6
7
/// Optimistically performs β-reduction (aka inlining).
8
/// β-reduction of `f e` happens if `f` only occurs exactly once in the program in callee position.
9
class
BetaRed
:
public
FPPass
<BetaRed, Def> {
10
public
:
11
BetaRed
(
PassMan
&
man
)
12
:
FPPass
(
man
,
"beta_red"
) {}
11
BetaRed
(
PassMan
&
man
) {
…
}
13
14
using
Data
=
LamSet
;
15
16
void
keep
(
Lam
* lam) { keep_.emplace(lam); }
17
18
private
:
19
const
Def
*
rewrite
(
const
Def
*)
override
;
20
undo_t
analyze
(
const
Proxy
*)
override
;
21
undo_t
analyze
(
const
Def
*)
override
;
22
23
LamSet
keep_;
24
};
9
class
BetaRed
:
public
FPPass
<BetaRed, Def> {
…
};
25
26
}
// namespace mim
mim::BetaRed::rewrite
const Def * rewrite(const Def *) override
Definition
beta_red.cpp:5
mim::BetaRed::keep
void keep(Lam *lam)
Definition
beta_red.h:16
mim::BetaRed::Data
LamSet Data
Definition
beta_red.h:14
mim::BetaRed::BetaRed
BetaRed(PassMan &man)
Definition
beta_red.h:11
mim::BetaRed::analyze
undo_t analyze(const Proxy *) override
Definition
beta_red.cpp:18
mim::Def
Base class for all Defs.
Definition
def.h:198
mim::FPPass< BetaRed, Def >::FPPass
FPPass(PassMan &man, std::string_view name)
Definition
pass.h:247
mim::Lam
A function.
Definition
lam.h:106
mim::PassMan
An optimizer that combines several optimizations in an optimal way.
Definition
pass.h:107
mim::Pass::man
PassMan & man()
Definition
pass.h:30
mim::Proxy
Definition
def.h:794
mim
Definition
ast.h:14
mim::LamSet
GIDSet< Lam * > LamSet
Definition
lam.h:203
mim::undo_t
size_t undo_t
Definition
pass.h:14
pass.h
include
mim
pass
beta_red.h
Generated by
1.13.2