compiler.cfg.value-numbering.graph: docs and test
parent
1eaa151a3c
commit
3810889f91
|
@ -0,0 +1,13 @@
|
|||
USING: help.markup help.syntax ;
|
||||
IN: compiler.cfg.value-numbering.graph
|
||||
|
||||
HELP: vregs>vns
|
||||
{ $var-description "assoc mapping vregs to value numbers this is the identity on canonical representatives." } ;
|
||||
|
||||
HELP: exprs>vns
|
||||
{ $var-description "assoc mapping expressions to value numbers." } ;
|
||||
|
||||
HELP: vns>insns
|
||||
{ $var-description "assoc mapping value numbers to instructions." } ;
|
||||
|
||||
ABOUT: "compiler.cfg.value-numbering.graph"
|
|
@ -0,0 +1,11 @@
|
|||
USING: arrays compiler.cfg.instructions
|
||||
compiler.cfg.value-numbering.graph kernel namespaces tools.test ;
|
||||
IN: compiler.cfg.value-numbering.graph.tests
|
||||
|
||||
{
|
||||
T{ ##and-imm { dst 4 } { src1 5 } { src2 6 } }
|
||||
} [
|
||||
H{ { 10 10 } } vregs>vns set
|
||||
10 4 5 6 f ##and-imm boa 2array 1array vns>insns set
|
||||
10 vn>insn
|
||||
] unit-test
|
|
@ -5,14 +5,10 @@ IN: compiler.cfg.value-numbering.graph
|
|||
|
||||
SYMBOL: input-expr-counter
|
||||
|
||||
! assoc mapping vregs to value numbers
|
||||
! this is the identity on canonical representatives
|
||||
SYMBOL: vregs>vns
|
||||
|
||||
! assoc mapping expressions to value numbers
|
||||
SYMBOL: exprs>vns
|
||||
|
||||
! assoc mapping value numbers to instructions
|
||||
SYMBOL: vns>insns
|
||||
|
||||
: vn>insn ( vn -- insn ) vns>insns get at ;
|
||||
|
|
Loading…
Reference in New Issue