! See http://factorcode.org/license.txt for BSD license.
USING: assocs compiler.cfg.instructions compiler.cfg.registers
compiler.cfg.ssa.destruction.leaders cpu.architecture deques
-dlists fry kernel locals namespaces sequences ;
+dlists fry kernel locals make namespaces sequences ;
FROM: sets => conjoin ;
IN: compiler.cfg.parallel-copy
to-do get push-all-back ;
: init-ready ( bs -- )
- locs get '[ _ key? not ] filter ready get push-all-front ;
+ locs get '[ _ key? ] reject ready get push-all-front ;
: init ( mapping -- )
<dlist> to-do set
PRIVATE>
:: parallel-mapping ( mapping temp: ( src -- dst ) quot: ( dst src -- ) -- )
- ! mapping is a list of { dst src } pairs
[
mapping init
to-do get [
] slurp-deque
] with-scope ; inline
-: parallel-copy ( mapping -- )
- next-vreg '[ drop _ ] [ any-rep ##copy, ] parallel-mapping ;
+: parallel-copy ( mapping -- insns )
+ [ next-vreg '[ drop _ ] [ any-rep ##copy, ] parallel-mapping ] { } make ;
<PRIVATE
PRIVATE>
-: parallel-copy-rep ( mapping -- )
- ! mapping is a list of { dst src } pairs
- H{ } clone temp-vregs set
- [ rep-of temp-vreg ] [ dup rep-of ##copy, ] parallel-mapping ;
+: parallel-copy-rep ( mapping -- insns )
+ [
+ H{ } clone temp-vregs set
+ [ rep-of temp-vreg ] [ dup rep-of ##copy, ] parallel-mapping
+ ] { } make ;