Revert "compiler.cfg: change linear ordering to place GC call blocks at the end"

This reverts commit 544a288192.
db4
Slava Pestov 2010-07-27 23:58:41 -04:00
parent a6c487c3b7
commit 5fc9aa05b0
3 changed files with 9 additions and 18 deletions

View File

@ -1,8 +1,7 @@
! Copyright (C) 2009, 2010 Slava Pestov.
! Copyright (C) 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit kernel namespaces
sequences math compiler.utilities compiler.cfg
compiler.cfg.instructions compiler.cfg.rpo
USING: accessors combinators.short-circuit kernel sequences math
compiler.utilities compiler.cfg compiler.cfg.instructions compiler.cfg.rpo
compiler.cfg.predecessors compiler.cfg.utilities ;
IN: compiler.cfg.block-joining
@ -24,23 +23,15 @@ IN: compiler.cfg.block-joining
: update-successors ( bb pred -- )
[ successors>> ] dip successors<< ;
: join-unlikely ( bb pred -- )
over unlikely?>> [ t >>unlikely? ] when 2drop ;
: join-block ( bb pred -- )
[ join-instructions ]
[ update-successors ]
[ join-unlikely ]
2tri ;
SYMBOL: changed?
[ join-instructions ] [ update-successors ] 2bi ;
: join-blocks ( cfg -- cfg' )
needs-predecessors
dup post-order [
dup join-block?
[ changed? on dup predecessor join-block ] [ drop ] if
[ dup predecessor join-block ] [ drop ] if
] each
changed? get [ cfg-changed predecessors-changed ] when ;
cfg-changed predecessors-changed ;

View File

@ -4,7 +4,7 @@ USING: kernel compiler.cfg.representations
compiler.cfg.scheduling compiler.cfg.gc-checks
compiler.cfg.save-contexts compiler.cfg.ssa.destruction
compiler.cfg.build-stack-frame compiler.cfg.linear-scan
compiler.cfg.stacks.uninitialized compiler.cfg.block-joining ;
compiler.cfg.stacks.uninitialized ;
IN: compiler.cfg.finalization
: finalize-cfg ( cfg -- cfg' )
@ -15,5 +15,4 @@ IN: compiler.cfg.finalization
insert-save-contexts
destruct-ssa
linear-scan
join-blocks
build-stack-frame ;

View File

@ -70,7 +70,8 @@ SYMBOLS: work-list loop-heads visited ;
init-linearization-order
[ work-list get [ process-block ] slurp-deque ] { } make
[ unlikely?>> not ] partition append ;
! [ unlikely?>> not ] partition append
;
PRIVATE>