]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg.stacks.local: test and fix for a silly bug in
authorBjörn Lindqvist <bjourne@gmail.com>
Wed, 29 Apr 2015 15:03:50 +0000 (17:03 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Wed, 29 Apr 2015 16:32:00 +0000 (09:32 -0700)
compute-local-kill-set (switched the order on ds and rs)

basis/compiler/cfg/stacks/local/local-tests.factor
basis/compiler/cfg/stacks/local/local.factor

index 87a23a9d7f955ff54309279f8b39038f5cf9882a..df3cfe3e8b067cb5e8a9be9c4f97317002c58d2b 100644 (file)
@@ -69,6 +69,25 @@ IN: compiler.cfg.stacks.local.tests
     ] V{ } make
 ] cfg-unit-test
 
+! compute-local-kill-set
+{ 0 } [
+    V{ } 0 insns>block 0 0 pick record-stack-heights
+    compute-local-kill-set sets:cardinality
+] unit-test
+
+{ HS{ R -4 } } [
+    V{ } 0 insns>block 4 4 pick record-stack-heights
+    { { 8 0 } { 3 0 } } height-state set
+    compute-local-kill-set
+] unit-test
+
+{ HS{ D -1 D -2 } } [
+    V{ } 0 insns>block [ 2 0 rot record-stack-heights ] keep
+    { { 0 0 } { 0 0 } } height-state set
+    compute-local-kill-set
+] cfg-unit-test
+
+! translate-local-loc
 { D 2 } [
     D 3 { { 1 2 } { 3 4 } } translate-local-loc
 ] unit-test
@@ -96,14 +115,3 @@ IN: compiler.cfg.stacks.local.tests
 { H{ { D -1 40 } } } [
     D 1 inc-stack 40 D 0 replace-loc replaces get
 ] cfg-unit-test
-
-{ 0 } [
-    V{ } 0 insns>block 0 0 pick record-stack-heights
-    compute-local-kill-set sets:cardinality
-] unit-test
-
-{ HS{ R -4 } } [
-    V{ } 0 insns>block 4 4 pick record-stack-heights
-    { { 8 0 } { 3 0 } } height-state set
-    compute-local-kill-set
-] unit-test
index e144258c50bf6fb31bfa5044456da67339774d84..b1dfdaaef6823840e9f4c54baa887b6aa5357b57 100644 (file)
@@ -70,7 +70,7 @@ SYMBOLS: local-peek-set replaces ;
     height-state get translate-local-loc replaces get set-at ;
 
 : compute-local-kill-set ( basic-block -- set )
-    [ rs-heights get at ] [ ds-heights get at ] bi
+    [ ds-heights get at ] [ rs-heights get at ] bi
     height-state get local-kill-set ;
 
 : begin-local-analysis ( basic-block -- )