compiler.cfg.stacks.local: test and fix for a silly bug in

compute-local-kill-set (switched the order on ds and rs)
db4
Björn Lindqvist 2015-04-29 17:03:50 +02:00 committed by John Benediktsson
parent 9fc73c3355
commit b4e7ffede4
2 changed files with 20 additions and 12 deletions

View 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

View 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 -- )