From 4ac74e93041d8f4d5340da3e178472267131a0aa Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 14 Jul 2009 20:42:50 -0500 Subject: [PATCH] compiler.cfg.branch-splitting: don't split if there's one predecessor --- basis/compiler/cfg/branch-splitting/branch-splitting.factor | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/basis/compiler/cfg/branch-splitting/branch-splitting.factor b/basis/compiler/cfg/branch-splitting/branch-splitting.factor index 0dd963125f..9d6e59e4da 100644 --- a/basis/compiler/cfg/branch-splitting/branch-splitting.factor +++ b/basis/compiler/cfg/branch-splitting/branch-splitting.factor @@ -65,15 +65,15 @@ UNION: irrelevant ##peek ##replace ##inc-d ##inc-r ; : split-instructions? ( insns -- ? ) [ irrelevant? not ] count 5 <= ; -: split-branches? ( bb -- ? ) +: split-branch? ( bb -- ? ) { [ dup successors>> [ back-edge? ] with any? not ] - [ predecessors>> length 1 4 between? ] + [ predecessors>> length 2 4 between? ] [ instructions>> split-instructions? ] } 1&& ; : split-branches ( cfg -- cfg' ) dup [ - dup split-branches? [ split-branch ] [ drop ] if + dup split-branch? [ split-branch ] [ drop ] if ] each-basic-block cfg-changed ;