Handbook
Glossary
remove-unused-spill-phis ( cfg -- )
Vocabulary
compiler
.
cfg
.
register-allocation
.
chordal
.
spilling
Inputs
cfg
an
object
Outputs
None
Definition
USING:
accessors
assocs
compiler.cfg.instructions
compiler.cfg.linearization
compiler.cfg.register-allocation.chordal.spilling.next-use
compiler.cfg.rpo
compiler.utilities
kernel
sequences
;
IN:
compiler.cfg.register-allocation.chordal.spilling
::
remove-unused-spill-phis
( cfg -- )
cfg
cfg>insns
:>
instructions instructions
[
##phi?
]
filter
:>
phis
H{
}
clone
:>
needed instructions
[
##phi?
]
reject
[
spill-insn-uses
[
needed
conjoin
]
each
]
each
t
:>
changed!
[
changed
]
[
needed
assoc-size
:>
before phis
[|
phi |
phi
dst>>
needed
key?
[
phi
inputs>>
values
[
needed
conjoin
]
each
]
when
]
each
needed
assoc-size
before
=
not
changed!
]
while
cfg
[|
bb |
bb
[
[|
insn |
insn
##phi?
[
insn
dst>>
needed
key?
not
]
[
f
]
if
dup
[
"dead-phis-removed"
spill-stat
]
when
]
reject
]
change-instructions
drop
]
each-basic-block
;