compiler.cfg.renaming compiler.cfg.instructions compiler.cfg.utilities ;
IN: compiler.cfg.branch-splitting
-: clone-renamings ( insns -- assoc )
- [ defs-vregs ] map concat [ dup fresh-vreg ] H{ } map>assoc ;
-
: clone-instructions ( insns -- insns' )
- dup clone-renamings renamings [
- [
- clone
- dup rename-insn-defs
- dup rename-insn-uses
- dup fresh-insn-temps
- ] map
- ] with-variable ;
+ [ clone dup fresh-insn-temps ] map ;
: clone-basic-block ( bb -- bb' )
! The new block gets the same RPO number as the old one.
UNION: irrelevant ##peek ##replace ##inc-d ##inc-r ;
-: split-instructions? ( insns -- ? )
- [ [ irrelevant? not ] count 5 <= ]
- [ last ##fixnum-overflow? not ]
- bi and ;
+: split-instructions? ( insns -- ? ) [ irrelevant? not ] count 5 <= ;
: split-branch? ( bb -- ? )
{