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.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors assocs compiler.cfg compiler.cfg.graphviz
compiler.cfg.gvn compiler.cfg.gvn.expressions
compiler.cfg.gvn.graph compiler.cfg.optimizer continuations
formatting graphviz graphviz.notation graphviz.render
io.directories kernel math.parser namespaces prettyprint
sequences sorting splitting tools.annotations ;
USING: accessors assocs compiler.cfg compiler.cfg.debugger
compiler.cfg.graphviz compiler.cfg.gvn
compiler.cfg.gvn.expressions compiler.cfg.gvn.graph
compiler.cfg.optimizer continuations formatting graphviz
graphviz.notation graphviz.render io.directories kernel
math.parser namespaces prettyprint sequences sorting splitting
tools.annotations ;
IN: compiler.cfg.gvn.testing
GENERIC: expr>str ( expr -- str )
@ -94,3 +95,13 @@ SYMBOL: iteration
: watch-gvn ( path quot -- )
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 ;