cvs
Slava Pestov 2005-09-04 23:52:50 +00:00
parent 24d3550168
commit 78fbeb867e
2 changed files with 14 additions and 6 deletions

View File

@ -113,6 +113,8 @@ sequences io vectors words ;
"/library/bootstrap/image.factor"
"/library/compiler/architecture.factor"
"/library/inference/shuffle.factor"
"/library/inference/dataflow.factor"
"/library/inference/inference.factor"
@ -129,7 +131,6 @@ sequences io vectors words ;
"/library/inference/call-optimizers.factor"
"/library/inference/print-dataflow.factor"
"/library/compiler/architecture.factor"
"/library/compiler/assembler.factor"
"/library/compiler/relocate.factor"
"/library/compiler/xt.factor"

View File

@ -1,8 +1,8 @@
! Copyright (C) 2004, 2005 Slava Pestov.
! See http://factor.sf.net/license.txt for BSD license.
IN: inference
USING: generic hashtables inference kernel lists
matrices namespaces sequences vectors ;
USING: compiler-frontend generic hashtables inference kernel
lists math matrices namespaces sequences vectors ;
! We use the recursive-state variable here, to track nested
! label scopes, to prevent infinite loops when inlining
@ -55,10 +55,17 @@ M: #push optimize-node* ( node -- node/t )
[ node-out-d empty? ] prune-if ;
! #shuffle
: compose-shuffle-nodes ( #shuffle #shuffle -- #shuffle/t )
[ >r node-shuffle r> node-shuffle compose-shuffle ] keep
over shuffle-in-d length pick shuffle-in-r length + vregs > [
2drop t
] [
[ set-node-shuffle ] keep
] ifte ;
M: #shuffle optimize-node* ( node -- node/t )
dup node-successor dup #shuffle? [
[ >r node-shuffle r> node-shuffle compose-shuffle ] keep
[ set-node-shuffle ] keep
compose-shuffle-nodes
] [
drop [
dup node-in-d empty? swap node-in-r empty? and