compiler.cfg.ssa.destruction.copies: factor out add-instructions combinator into compiler.cfg.utilities
parent
cff5976a0d
commit
8aa41672ca
|
@ -1,7 +1,8 @@
|
||||||
! Copyright (C) 2009 Slava Pestov.
|
! Copyright (C) 2009 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors assocs hashtables fry kernel make namespaces sets
|
USING: accessors assocs hashtables fry kernel make namespaces
|
||||||
sequences compiler.cfg.ssa.destruction.state compiler.cfg.parallel-copy ;
|
sets sequences compiler.cfg.ssa.destruction.state
|
||||||
|
compiler.cfg.parallel-copy compiler.cfg.utilities ;
|
||||||
IN: compiler.cfg.ssa.destruction.copies
|
IN: compiler.cfg.ssa.destruction.copies
|
||||||
|
|
||||||
ERROR: bad-copy ;
|
ERROR: bad-copy ;
|
||||||
|
@ -20,9 +21,5 @@ ERROR: bad-copy ;
|
||||||
|
|
||||||
: insert-copies ( -- )
|
: insert-copies ( -- )
|
||||||
waiting get [
|
waiting get [
|
||||||
[ instructions>> building ] dip '[
|
'[ _ compute-copies parallel-copy ] add-instructions
|
||||||
building get pop
|
|
||||||
_ compute-copies parallel-copy
|
|
||||||
,
|
|
||||||
] with-variable
|
|
||||||
] assoc-each ;
|
] assoc-each ;
|
|
@ -43,6 +43,13 @@ SYMBOL: visited
|
||||||
to predecessors>> [ dup from eq? [ drop bb ] when ] change-each
|
to predecessors>> [ dup from eq? [ drop bb ] when ] change-each
|
||||||
from successors>> [ dup to eq? [ drop bb ] when ] change-each ;
|
from successors>> [ dup to eq? [ drop bb ] when ] change-each ;
|
||||||
|
|
||||||
|
: add-instructions ( bb quot -- )
|
||||||
|
[ instructions>> building ] dip '[
|
||||||
|
building get pop
|
||||||
|
@
|
||||||
|
,
|
||||||
|
] with-variable ; inline
|
||||||
|
|
||||||
: <simple-block> ( insns -- bb )
|
: <simple-block> ( insns -- bb )
|
||||||
<basic-block>
|
<basic-block>
|
||||||
swap >vector
|
swap >vector
|
||||||
|
|
Loading…
Reference in New Issue