compiler.cfg.branch-splitting: now that we do SSA construction we can split branches with fixnum overflow ops (which have a live-out)
parent
7f87335afe
commit
93c58a8bb5
|
@ -6,18 +6,8 @@ compiler.cfg.def-use compiler.cfg compiler.cfg.rpo
|
||||||
compiler.cfg.renaming compiler.cfg.instructions compiler.cfg.utilities ;
|
compiler.cfg.renaming compiler.cfg.instructions compiler.cfg.utilities ;
|
||||||
IN: compiler.cfg.branch-splitting
|
IN: compiler.cfg.branch-splitting
|
||||||
|
|
||||||
: clone-renamings ( insns -- assoc )
|
|
||||||
[ defs-vregs ] map concat [ dup fresh-vreg ] H{ } map>assoc ;
|
|
||||||
|
|
||||||
: clone-instructions ( insns -- insns' )
|
: clone-instructions ( insns -- insns' )
|
||||||
dup clone-renamings renamings [
|
[ clone dup fresh-insn-temps ] map ;
|
||||||
[
|
|
||||||
clone
|
|
||||||
dup rename-insn-defs
|
|
||||||
dup rename-insn-uses
|
|
||||||
dup fresh-insn-temps
|
|
||||||
] map
|
|
||||||
] with-variable ;
|
|
||||||
|
|
||||||
: clone-basic-block ( bb -- bb' )
|
: clone-basic-block ( bb -- bb' )
|
||||||
! The new block gets the same RPO number as the old one.
|
! The new block gets the same RPO number as the old one.
|
||||||
|
@ -62,10 +52,7 @@ IN: compiler.cfg.branch-splitting
|
||||||
|
|
||||||
UNION: irrelevant ##peek ##replace ##inc-d ##inc-r ;
|
UNION: irrelevant ##peek ##replace ##inc-d ##inc-r ;
|
||||||
|
|
||||||
: split-instructions? ( insns -- ? )
|
: split-instructions? ( insns -- ? ) [ irrelevant? not ] count 5 <= ;
|
||||||
[ [ irrelevant? not ] count 5 <= ]
|
|
||||||
[ last ##fixnum-overflow? not ]
|
|
||||||
bi and ;
|
|
||||||
|
|
||||||
: split-branch? ( bb -- ? )
|
: split-branch? ( bb -- ? )
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue