compiler.cfg.gvn.testing: some helper words for debugging CFGs directly

db4
Alex Vondrak 2012-08-10 22:53:30 -07:00 committed by John Benediktsson
parent 803a1cb565
commit 3ff0b1a1ec
1 changed files with 17 additions and 6 deletions

View File

@ -1,11 +1,12 @@
! Copyright (C) 2011 Alex Vondrak. ! Copyright (C) 2011 Alex Vondrak.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs compiler.cfg compiler.cfg.graphviz USING: accessors assocs compiler.cfg compiler.cfg.debugger
compiler.cfg.gvn compiler.cfg.gvn.expressions compiler.cfg.graphviz compiler.cfg.gvn
compiler.cfg.gvn.graph compiler.cfg.optimizer continuations compiler.cfg.gvn.expressions compiler.cfg.gvn.graph
formatting graphviz graphviz.notation graphviz.render compiler.cfg.optimizer continuations formatting graphviz
io.directories kernel math.parser namespaces prettyprint graphviz.notation graphviz.render io.directories kernel
sequences sorting splitting tools.annotations ; math.parser namespaces prettyprint sequences sorting splitting
tools.annotations ;
IN: compiler.cfg.gvn.testing IN: compiler.cfg.gvn.testing
GENERIC: expr>str ( expr -- str ) GENERIC: expr>str ( expr -- str )
@ -94,3 +95,13 @@ SYMBOL: iteration
: watch-gvn ( path quot -- ) : watch-gvn ( path quot -- )
annotate-gvn [ test-gvn ] [ reset-gvn ] [ ] cleanup ; annotate-gvn [ test-gvn ] [ reset-gvn ] [ ] cleanup ;
: watch-gvn-cfg ( path cfg -- )
annotate-gvn [
{ value-numbering } passes [
0 iteration [ watch-cfg ] with-variable
] with-variable
] [ reset-gvn ] [ ] cleanup ;
: watch-gvn-bb ( path insns -- )
0 test-bb cfg new 0 get >>entry watch-gvn-cfg ;