compiler.cfg.value-numbering.graph: docs and test

locals-and-roots
Björn Lindqvist 2016-05-19 16:10:06 +02:00
parent 1eaa151a3c
commit 3810889f91
3 changed files with 24 additions and 4 deletions

View File

@ -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"

View File

@ -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

View File

@ -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 ;