]> gitweb.factorcode.org Git - factor.git/commitdiff
compiler.cfg: clean up ##phi literals in tests
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Fri, 30 Apr 2010 22:40:34 +0000 (18:40 -0400)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Mon, 3 May 2010 21:34:24 +0000 (17:34 -0400)
basis/compiler/cfg/builder/builder-tests.factor
basis/compiler/cfg/gc-checks/gc-checks-tests.factor
basis/compiler/cfg/liveness/ssa/ssa-tests.factor
basis/compiler/cfg/representations/coalescing/coalescing-tests.factor
basis/compiler/cfg/representations/representations-tests.factor
basis/compiler/cfg/value-numbering/value-numbering-tests.factor

index 9ed7c592ceb4501b3e97e41131d7a15bd03f1a17..b8fde7fef6f9a1be714343cd1045dfadb8ba7681 100644 (file)
@@ -11,8 +11,8 @@ FROM: alien.c-types => int ;
 IN: compiler.cfg.builder.tests
 
 ! Just ensure that various CFGs build correctly.
-: unit-test-cfg ( quot -- )
-    '[ _ test-cfg [ [ optimize-cfg check-cfg ] with-cfg ] each ] [ ] swap unit-test ;
+: unit-test-builder ( quot -- )
+    '[ _ test-builder [ [ optimize-cfg check-cfg ] with-cfg ] each ] [ ] swap unit-test ;
 
 : blahblah ( nodes -- ? )
     { fixnum } declare [
@@ -105,7 +105,7 @@ IN: compiler.cfg.builder.tests
         set-string-nth-fast
     ]
 } [
-    unit-test-cfg
+    unit-test-builder
 ] each
 
 : test-1 ( -- ) test-1 ;
@@ -116,7 +116,7 @@ IN: compiler.cfg.builder.tests
     test-1
     test-2
     test-3
-} [ unit-test-cfg ] each
+} [ unit-test-builder ] each
 
 {
     byte-array
@@ -134,8 +134,8 @@ IN: compiler.cfg.builder.tests
         alien-float
         alien-double
     } [| word |
-        { class } word '[ _ declare 10 _ execute ] unit-test-cfg
-        { class fixnum } word '[ _ declare _ execute ] unit-test-cfg
+        { class } word '[ _ declare 10 _ execute ] unit-test-builder
+        { class fixnum } word '[ _ declare _ execute ] unit-test-builder
     ] each
     
     {
@@ -146,22 +146,22 @@ IN: compiler.cfg.builder.tests
         set-alien-unsigned-2
         set-alien-unsigned-4
     } [| word |
-        { fixnum class } word '[ _ declare 10 _ execute ] unit-test-cfg
-        { fixnum class fixnum } word '[ _ declare _ execute ] unit-test-cfg
+        { fixnum class } word '[ _ declare 10 _ execute ] unit-test-builder
+        { fixnum class fixnum } word '[ _ declare _ execute ] unit-test-builder
     ] each
     
-    { float class } \ set-alien-float '[ _ declare 10 _ execute ] unit-test-cfg
-    { float class fixnum } \ set-alien-float '[ _ declare _ execute ] unit-test-cfg
+    { float class } \ set-alien-float '[ _ declare 10 _ execute ] unit-test-builder
+    { float class fixnum } \ set-alien-float '[ _ declare _ execute ] unit-test-builder
     
-    { float class } \ set-alien-double '[ _ declare 10 _ execute ] unit-test-cfg
-    { float class fixnum } \ set-alien-double '[ _ declare _ execute ] unit-test-cfg
+    { float class } \ set-alien-double '[ _ declare 10 _ execute ] unit-test-builder
+    { float class fixnum } \ set-alien-double '[ _ declare _ execute ] unit-test-builder
     
-    { pinned-c-ptr class } \ set-alien-cell '[ _ declare 10 _ execute ] unit-test-cfg
-    { pinned-c-ptr class fixnum } \ set-alien-cell '[ _ declare _ execute ] unit-test-cfg
+    { pinned-c-ptr class } \ set-alien-cell '[ _ declare 10 _ execute ] unit-test-builder
+    { pinned-c-ptr class fixnum } \ set-alien-cell '[ _ declare _ execute ] unit-test-builder
 ] each
 
 : count-insns ( quot insn-check -- ? )
-    [ test-mr [ instructions>> ] map ] dip
+    [ test-regs [ instructions>> ] map ] dip
     '[ _ count ] map-sum ; inline
 
 : contains-insn? ( quot insn-check -- ? )
index de5e35aaa4fda2c357c7c067aa4f7a4b67e3b24e..496954de2c83cd87d6c51a7e1a251cc6b39b3730 100644 (file)
@@ -184,14 +184,11 @@ V{
 } 2 test-bb
 
 V{
-    T{ ##phi f 3 }
+    T{ ##phi f 3 H{ { 1 1 } { 2 2 } } }
     T{ ##allot f 1 64 byte-array }
     T{ ##branch }
 } 3 test-bb
 
-1 get 1 2array
-2 get 2 2array 2array 3 get instructions>> first (>>inputs)
-
 0 { 1 2 } edges
 1 3 edge
 2 3 edge
index 945d49272cf9723dffd4bb5955f7fb0dceb4e170..5413c65b320936b9ea76b45f7e5eb7630c6c723b 100644 (file)
@@ -24,14 +24,10 @@ V{
 } 3 test-bb
 
 V{
-    T{ ##phi f 2 }
+    T{ ##phi f 2 H{ { 2 0 } { 3 1 } } }
     T{ ##branch }
 } 4 test-bb
 
-2 get 0 2array
-3 get 1 2array 2array
-4 get instructions>> first (>>inputs)
-
 V{
     T{ ##branch }
 } 5 test-bb
index f22fe0d147a84a7e5ba900f5620089ed21aa9d2f..cc1bde36f1341d2bc68b1433a72b6c040b232d52 100644 (file)
@@ -26,16 +26,13 @@ V{
 } 2 test-bb
 
 V{
-    T{ ##phi f 3 }
+    T{ ##phi f 3 H{ { 1 0 } { 2 1 } } }
 } 3 test-bb
 
 0 { 1 2 } edges
 1 3 edge
 2 3 edge
 
-1 get 0 2array
-2 get 1 2array 2array 3 get instructions>> first (>>inputs)
-
 [ ] [ test-scc ] unit-test
 
 [ t ] [ 0 vreg>scc 1 vreg>scc = ] unit-test
index 3f406660ca0d550e6c41d4431a65dd0aba2c6533..f4728bc7e74639e473b71e9406c6e5e400c6e782 100644 (file)
@@ -251,7 +251,7 @@ V{
 } 2 test-bb
 
 V{
-    T{ ##phi f 3 }
+    T{ ##phi f 3 H{ { 1 1 } { 2 2 } } }
     T{ ##replace f 3 D 0 }
     T{ ##branch }
 } 3 test-bb
@@ -261,9 +261,6 @@ V{
     T{ ##return }
 } 4 test-bb
 
-1 get 1 2array
-2 get 2 2array 2array 3 get instructions>> first (>>inputs)
-
 0 { 1 2 } edges
 1 3 edge
 2 3 edge
@@ -298,7 +295,7 @@ V{
 } 2 test-bb
 
 V{
-    T{ ##phi f 4 }
+    T{ ##phi f 4 H{ { 1 2 } { 2 3 } } }
     T{ ##replace f 4 D 0 }
     T{ ##branch }
 } 3 test-bb
@@ -308,9 +305,6 @@ V{
     T{ ##return }
 } 4 test-bb
 
-1 get 2 2array
-2 get 3 2array 2array 3 get instructions>> first (>>inputs)
-
 0 { 1 2 } edges
 1 3 edge
 2 3 edge
@@ -371,7 +365,7 @@ cpu x86.32? [
     } 3 test-bb
 
     V{
-        T{ ##phi f 4 }
+        T{ ##phi f 4 H{ { 2 2 } { 3 3 } } }
         T{ ##peek f 5 D 0 }
         T{ ##add-float f 6 4 5 }
         T{ ##replace f 6 D 0 }
@@ -385,9 +379,6 @@ cpu x86.32? [
     test-diamond
     4 5 edge
 
-    2 get 2 2array
-    3 get 3 2array 2array 4 get instructions>> first (>>inputs)
-
     [ ] [ test-representations ] unit-test
 
     [ t ] [ 2 get instructions>> first ##load-double? ] unit-test
index 0b1b8ab0fe012a68999624bf043a7283df0f4332..b7084fb2d84d4e239f2b9a21e71a1ac4b4406ead 100644 (file)
@@ -2302,14 +2302,11 @@ V{
 } 3 test-bb
 
 V{
-    T{ ##phi f 3 }
+    T{ ##phi f 3 H{ { 2 1 } { 3 2 } } }
     T{ ##replace f 3 D 0 }
     T{ ##return }
 } 4 test-bb
 
-2 get 1 2array
-3 get 2 2array 2array 4 get instructions>> first (>>inputs)
-
 test-diamond
 
 [ ] [
@@ -2341,7 +2338,7 @@ V{
 } 2 test-bb
 
 V{
-    T{ ##phi f 3 V{ } }
+    T{ ##phi f 3 H{ { 1 1 } { 2 0 } } }
     T{ ##branch }
 } 3 test-bb
 
@@ -2350,9 +2347,6 @@ V{
     T{ ##return }
 } 4 test-bb
 
-1 get 1 2array
-2 get 0 2array 2array 3 get instructions>> first (>>inputs)
-
 test-diamond
 
 [ ] [