]> gitweb.factorcode.org Git - factor.git/commitdiff
fix typo
authorSlava Pestov <slava@factorcode.org>
Sun, 4 Sep 2005 23:52:50 +0000 (23:52 +0000)
committerSlava Pestov <slava@factorcode.org>
Sun, 4 Sep 2005 23:52:50 +0000 (23:52 +0000)
library/bootstrap/boot-stage1.factor
library/inference/optimizer.factor

index 470f9bc800a42f5d6063d151c8375509e90252b2..ac7a6a6a01c3f68c89704af5cfd9834a86934ce3 100644 (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"
@@ -128,8 +130,7 @@ sequences io vectors words ;
         "/library/inference/stack.factor"
         "/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"
index e90efc5ea984b572a00ea5889e01e56ab9673bd1..92b150d812e05012cbaff3ec0366d02964e4375c 100644 (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