Handbook
Glossary
#phi
High-level optimizer operating on lexical tree SSA IR
Prev:
#dispatch
Vocabulary
compiler
.
tree
Class description
#phi is a SSA tree node type that unifies two branches in an
#if
.
Definition
IN:
compiler.tree
TUPLE:
#phi
<
node
phi-in-d phi-info-d out-d terminated
;
Methods
USING:
accessors
compiler.tree
compiler.tree.def-use.simplified
kernel
sequences
stack-checker.branches
;
M:
#phi
actually-defined-by*
[
out-d>>
index
]
[
phi-in-d>>
]
bi
[
nth
dup
+bottom+
eq?
[
drop
]
[
(actually-defined-by)
]
if
]
with
each
;
USING:
accessors
compiler.tree
compiler.tree.def-use.simplified
kernel
sequences
;
M:
#phi
actually-used-by*
[
phi-in-d>>
[
index
]
with
map-find
drop
]
[
out-d>>
nth
]
bi
(actually-used-by)
;
USING:
accessors
arrays
columns
compiler.tree
compiler.tree.checker
kernel
;
M:
#phi
check-node*
[
[
phi-in-d>>
<flipped>
]
[
out-d>>
]
bi
2array
check-lengths
]
[
phi-in-d>>
check-lengths
]
bi
;
USING:
compiler.tree
compiler.tree.checker
kernel
namespaces
sequences
;
M:
#phi
check-stack-flow*
branch-out
get
[
]
any?
[
[
check-phi-in
]
[
set-phi-datastack
]
[
check-out-d
]
tri
]
[
drop
terminated?
on
]
if
;
USING:
accessors
compiler.tree
compiler.tree.cleanup
compiler.tree.combinators
kernel
namespaces
;
M:
#phi
cleanup-tree*
live-branches
get
[
[
sift-children
]
curry
change-phi-in-d
]
[
[
sift-children
]
curry
change-phi-info-d
]
[
[
sift-children
]
curry
change-terminated
]
tri
eliminate-phi
live-branches
off
;
USING:
accessors
compiler.tree
compiler.tree.propagation.copy
kernel
sequences
;
M:
#phi
compute-copy-equiv*
[
phi-in-d>>
flip
]
[
out-d>>
]
bi
compute-phi-equiv
;
USING:
accessors
compiler.tree
compiler.tree.dead-code.branches
compiler.tree.dead-code.liveness
kernel
;
M:
#phi
compute-live-values*
[
out-d>>
]
[
phi-in-d>>
]
bi
look-at-phi
;
USING:
compiler.cfg.builder
compiler.tree
kernel
;
M:
#phi
emit-node
drop
;
USING:
accessors
compiler.tree
compiler.tree.escape-analysis.branches
compiler.tree.escape-analysis.nodes
kernel
sequences
;
M:
#phi
escape-analysis*
[
phi-in-d>>
flip
]
[
out-d>>
]
bi
merge-allocations
;
USING:
accessors
compiler.tree
compiler.tree.def-use
sequences
sets
stack-checker.branches
;
M:
#phi
node-uses-values
phi-in-d>>
concat
remove-bottom
members
;
USING:
accessors
compiler.tree
compiler.tree.normalization
kernel
namespaces
;
M:
#phi
normalize*
remaining-introductions
get
swap
dup
terminated>>
[
eliminate-phi-introductions
]
curry
change-phi-in-d
;
USING:
accessors
compiler.tree
compiler.tree.propagation.branches
compiler.tree.propagation.info
compiler.tree.propagation.nodes
kernel
namespaces
sequences
;
M:
#phi
propagate-after
condition-value
get
[
[
out-d>>
]
[
phi-in-d>>
flip
]
[
phi-info-d>>
flip
]
tri
[
[
possible-boolean-values
]
map
branch-phi-constraints
]
3each
]
[
drop
]
if
;
USING:
accessors
compiler.tree
compiler.tree.propagation.branches
compiler.tree.propagation.nodes
kernel
sequences
;
M:
#phi
propagate-before
[
annotate-phi-inputs
]
[
[
phi-info-d>>
flip
]
[
out-d>>
]
bi
merge-value-infos
]
bi
;
USING:
combinators
compiler.tree
compiler.tree.dead-code.branches
compiler.tree.dead-code.liveness
;
M:
#phi
remove-dead-code*
{
[
hoist-drops
]
[
remove-phi-inputs
]
[
remove-phi-outputs
]
[
]
}
cleave
;
USING:
accessors
compiler.tree
compiler.tree.normalization.renaming
sequences
;
M:
#phi
rename-node-values*
[
[
rename-values
]
map
]
change-phi-in-d
;
USING:
accessors
compiler.tree
compiler.tree.tuple-unboxing
sequences
stack-checker.branches
;
M:
#phi
unbox-tuples*
[
[
flatten-values
]
map
pad-with-bottom
]
change-phi-in-d
[
flatten-values
]
change-out-d
;