compiler.cfg.linear-scan.allocation.spilling: fix stack effect
parent
89e98e96a4
commit
2cc8b5e7de
|
@ -32,8 +32,8 @@ HELP: split-for-spill
|
||||||
{ $values
|
{ $values
|
||||||
{ "live-interval" live-interval-state }
|
{ "live-interval" live-interval-state }
|
||||||
{ "n" integer }
|
{ "n" integer }
|
||||||
{ "before" live-interval-state }
|
{ "before/f" $maybe live-interval-state }
|
||||||
{ "after" live-interval-state }
|
{ "after/f" $maybe live-interval-state }
|
||||||
} { $description "During register allocation an interval needs to be split so that the 'after' part of it can be placed in a spill slot." } ;
|
} { $description "During register allocation an interval needs to be split so that the 'after' part of it can be placed in a spill slot." } ;
|
||||||
|
|
||||||
HELP: spill-intersecting
|
HELP: spill-intersecting
|
||||||
|
|
|
@ -36,6 +36,11 @@ IN: compiler.cfg.linear-scan.allocation.spilling.tests
|
||||||
test-live-interval last-use-rep
|
test-live-interval last-use-rep
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
! spill-before
|
||||||
|
{ f } [
|
||||||
|
30 <live-interval> spill-before
|
||||||
|
] unit-test
|
||||||
|
|
||||||
! trim-after-ranges
|
! trim-after-ranges
|
||||||
{
|
{
|
||||||
T{ live-interval-state
|
T{ live-interval-state
|
||||||
|
|
|
@ -61,7 +61,7 @@ ERROR: bad-live-ranges interval ;
|
||||||
} cleave
|
} cleave
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
: split-for-spill ( live-interval n -- before after )
|
: split-for-spill ( live-interval n -- before/f after/f )
|
||||||
split-interval [ spill-before ] [ spill-after ] bi* ;
|
split-interval [ spill-before ] [ spill-after ] bi* ;
|
||||||
|
|
||||||
: find-next-use ( live-interval new -- n )
|
: find-next-use ( live-interval new -- n )
|
||||||
|
@ -96,8 +96,7 @@ ERROR: bad-live-ranges interval ;
|
||||||
|
|
||||||
: spill ( live-interval n -- )
|
: spill ( live-interval n -- )
|
||||||
split-for-spill
|
split-for-spill
|
||||||
[ [ add-handled ] when* ]
|
[ [ add-handled ] when* ] [ [ add-unhandled ] when* ] bi* ;
|
||||||
[ [ add-unhandled ] when* ] bi* ;
|
|
||||||
|
|
||||||
:: spill-intersecting-active ( new reg -- )
|
:: spill-intersecting-active ( new reg -- )
|
||||||
new active-intervals-for [ [ reg>> reg = ] find swap dup ] keep
|
new active-intervals-for [ [ reg>> reg = ] find swap dup ] keep
|
||||||
|
|
Loading…
Reference in New Issue