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