]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix an oversight on def-use analysis
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 24 Jul 2008 07:32:31 +0000 (02:32 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 24 Jul 2008 07:32:31 +0000 (02:32 -0500)
unfinished/compiler/tree/def-use/def-use.factor
unfinished/compiler/tree/propagation/propagation-tests.factor

index c912582a388b94244538dc82055abb009e24a123..51899c1dcf460695f3f88813b62774d4b7ec2474 100755 (executable)
@@ -44,6 +44,8 @@ M: #introduce node-defs-values values>> ;
 
 M: #>r node-defs-values out-r>> ;
 
+M: #phi node-defs-values [ out-d>> ] [ out-r>> ] bi append ;
+
 M: node node-defs-values out-d>> ;
 
 : node-def-use ( node -- )
index 5533cd140753a5ddc666dbcfd24a7619b990d8b1..9fcfbdefffd21d1f33021983279bf6ee22e7b765 100644 (file)
@@ -220,3 +220,15 @@ IN: compiler.tree.propagation.tests
 [ V{ fixnum } ] [
     [ >fixnum dup 100 < [ 1+ ] [ "Oops" throw ] if ] final-classes
 ] unit-test
+
+[ V{ -1 } ] [
+    [ 0 dup 100 < not [ 1+ ] [ 1- ] if ] final-literals
+] unit-test
+
+[ V{ fixnum } ] [
+    [ [ 1 >r ] [ 2 >r ] if r> 3 + ] final-classes
+] unit-test
+
+[ V{ 2 } ] [
+    [ [ 1 ] [ 1 ] if 1 + ] final-literals
+] unit-test