Handbook
Glossary
compute-candidates ( cfg -- )
Vocabulary
compiler
.
cfg
.
value-numbering
.
global
.
private
Inputs
cfg
an
object
Outputs
None
Definition
USING:
accessors
assocs
compiler.cfg.instructions
compiler.cfg.rpo
compiler.cfg.value-numbering.graph
kernel
math
namespaces
sequences
;
IN:
compiler.cfg.value-numbering.global.private
::
compute-candidates
( cfg -- )
H{
}
clone
:>
counts
H{
}
clone
:>
candidates cfg
[
[|
insn |
insn
elimination-candidate?
[
insn
dst>>
vreg>vn
:>
vn vn
[
vn counts
inc-at
insn
##phi?
[
vn
congruence-classes
get
at
length
1
>
~quotation~
when
]
when
]
when
]
when
]
each
]
simple-analysis
counts
[|
vn count | count 1
>
[
vn vn candidates
set-at
]
when
]
assoc-each
candidates
candidate-vns
set
;