compiler.cfg.branch-splitting: don't split if there's one predecessor

db4
Slava Pestov 2009-07-14 20:42:50 -05:00
parent 11731f8d48
commit 4ac74e9304
1 changed files with 3 additions and 3 deletions

View File

@ -65,15 +65,15 @@ UNION: irrelevant ##peek ##replace ##inc-d ##inc-r ;
: split-instructions? ( insns -- ? ) : split-instructions? ( insns -- ? )
[ irrelevant? not ] count 5 <= ; [ irrelevant? not ] count 5 <= ;
: split-branches? ( bb -- ? ) : split-branch? ( bb -- ? )
{ {
[ dup successors>> [ back-edge? ] with any? not ] [ dup successors>> [ back-edge? ] with any? not ]
[ predecessors>> length 1 4 between? ] [ predecessors>> length 2 4 between? ]
[ instructions>> split-instructions? ] [ instructions>> split-instructions? ]
} 1&& ; } 1&& ;
: split-branches ( cfg -- cfg' ) : split-branches ( cfg -- cfg' )
dup [ dup [
dup split-branches? [ split-branch ] [ drop ] if dup split-branch? [ split-branch ] [ drop ] if
] each-basic-block ] each-basic-block
cfg-changed ; cfg-changed ;