]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix dead load/store elimination
authorslava <slava@factorcode.org>
Thu, 20 Apr 2006 20:28:08 +0000 (20:28 +0000)
committerslava <slava@factorcode.org>
Thu, 20 Apr 2006 20:28:08 +0000 (20:28 +0000)
TODO.FACTOR.txt
library/compiler/stack.factor
library/compiler/templates.factor
library/test/compiler/templates.factor

index c26624ce0abb90327eb868bb52bfb464026bc97b..f3862f64906c65a38c20b7bad18a74e839cc7e2c 100644 (file)
@@ -1,5 +1,7 @@
 should fix in 0.82:
 
+- constant branch folding
+- getenv, setenv, fast-slot stuff
 - 3 >n fep
 - amd64 %box-struct
 - get factor running on mac intel
@@ -27,6 +29,7 @@ should fix in 0.82:
 
 + ui/help:
 
+- polish OS X menu bar code
 - help search
 - reimplement clicking input
 - reimplement tab completion
@@ -74,7 +77,6 @@ should fix in 0.82:
 - the invalid recursion form case needs to be fixed, for inlines too
 - code gc
 - compiled gc check slows things down
-- fix branch folding
 
 + misc:
 
index 4583328ad41142eab337a7bec42415b503407289..9666824bb7f8494493c1aaec75f8d8513a6b46dd 100644 (file)
@@ -8,8 +8,8 @@ namespaces prettyprint sequences vectors words ;
     2dup length <= [
         cut-phantom
     ] [
-        [ phantom-locs ] keep [ length swap tail-slice ] keep
-        append
+        [ phantom-locs ] keep [ length swap head-slice* ] keep
+        [ append 0 ] keep set-length
     ] if ;
 
 : phantom-shuffle-inputs ( shuffle -- locs locs )
@@ -26,9 +26,9 @@ namespaces prettyprint sequences vectors words ;
     free-vregs get length <= ;
 
 : phantom-shuffle ( shuffle -- )
-    compute-free-vregs sufficient-shuffle-vregs? [
+    compute-free-vregs sufficient-shuffle-vregs? [
         end-basic-block compute-free-vregs
-    ] unless
+    ] unless
     [ phantom-shuffle-inputs ] keep
     [ shuffle* ] keep adjust-shuffle
     (template-outputs) ;
index 1126c4f8c9bed400e95cb47d78a5e73be764140f..fa0093132cea7c1f517a0116f96b10366e0f731a 100644 (file)
@@ -90,7 +90,7 @@ SYMBOL: phantom-r
 : lazy-load ( value loc -- value )
     over ds-loc? pick cs-loc? or [
         dupd = [
-            drop f
+            >r alloc-reg <vreg> dup r> %peek , ! drop f
         ] [
             >r alloc-reg <vreg> dup r> %peek ,
         ] if
@@ -166,11 +166,8 @@ SYMBOL: any-reg
     >r phantom-d get template-match? r> and ;
 
 : split-template ( template phantom -- slow fast )
-    over length over length <= [
-        drop { } swap
-    ] [
-        length swap cut*
-    ] if ;
+    over length over length <=
+    [ drop { } swap ] [ length swap cut* ] if ;
 
 : split-templates ( template template -- slow slow fast fast )
     >r phantom-d get split-template r>
index 5a1ddc5bbc7de9014fce30f4a46590f33db216e6..54862ae6ebbaae8177a74bf509e6beb66c5fc186 100644 (file)
@@ -14,6 +14,10 @@ math-internals namespaces test ;
 [ 0 ] [ 3 [ tag ] compile-1 ] unit-test
 [ 0 3 ] [ 3 [ [ tag ] keep ] compile-1 ] unit-test
 
+[ 2 3 ] [ 3 [ 2 swap ] compile-1 ] unit-test
+
+[ 2 3 4 ] [ 3 [ 2 swap 4 ] compile-1 ] unit-test
+
 [ { 1 2 3 } { 1 4 3 } 8 8 ]
 [ { 1 2 3 } { 1 4 3 } [ over type over type ] compile-1 ]
 unit-test