compiler.cfg: the id slot of basic-block appears to not be needed
parent
5cd44dc07c
commit
aa6fbf475e
|
@ -4,22 +4,18 @@ USING: accessors kernel layouts math namespaces vectors ;
|
|||
IN: compiler.cfg
|
||||
|
||||
TUPLE: basic-block < identity-tuple
|
||||
{ id integer }
|
||||
number
|
||||
{ instructions vector }
|
||||
{ successors vector }
|
||||
{ predecessors vector }
|
||||
{ kill-block? boolean } ;
|
||||
number
|
||||
{ instructions vector }
|
||||
{ successors vector }
|
||||
{ predecessors vector }
|
||||
{ kill-block? boolean } ;
|
||||
|
||||
: <basic-block> ( -- bb )
|
||||
basic-block new
|
||||
\ basic-block counter >>id
|
||||
V{ } clone >>instructions
|
||||
V{ } clone >>successors
|
||||
V{ } clone >>predecessors ;
|
||||
|
||||
M: basic-block hashcode* nip id>> ;
|
||||
|
||||
TUPLE: cfg
|
||||
{ entry basic-block }
|
||||
word
|
||||
|
|
|
@ -50,7 +50,7 @@ IN: compiler.cfg.intrinsics.simd.tests
|
|||
|
||||
: test-compiler-env ( -- x )
|
||||
H{ } clone
|
||||
T{ basic-block { id 0 } }
|
||||
T{ basic-block }
|
||||
[ \ basic-block pick set-at ]
|
||||
[ 0 swap associate \ ds-heights pick set-at ]
|
||||
[ 0 swap associate \ rs-heights pick set-at ] tri
|
||||
|
|
|
@ -11,4 +11,6 @@ V{ } 2 test-bb
|
|||
0 { 1 1 } edges
|
||||
1 2 edge
|
||||
|
||||
[ t ] [ 0 get block>cfg linearization-order [ id>> ] map all-unique? ] unit-test
|
||||
{ { 0 1 2 } } [
|
||||
0 get block>cfg linearization-order [ number>> ] map
|
||||
] unit-test
|
||||
|
|
Loading…
Reference in New Issue