mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-11 13:45:58 +02:00
* Moved spilling of registers which have the initial memory location and are used only once to a stage after coalescing is done. This produces a better code.
git-svn-id: trunk@46836 -
This commit is contained in:
parent
c06744b62b
commit
b5abefe03e
@ -641,17 +641,10 @@ unit rgobj;
|
||||
i8086 where indexed memory access instructions allow only
|
||||
few registers as arguments and additionally the calling convention
|
||||
provides no general purpose volatile registers.
|
||||
|
||||
Also spill registers which have the initial memory location
|
||||
and are used only once. This allows to access the memory location
|
||||
directly, without preloading it to a register.
|
||||
}
|
||||
for i:=first_imaginary to maxreg-1 do
|
||||
with reginfo[i] do
|
||||
if (real_reg_interferences>=usable_registers_cnt) or
|
||||
{ also spill registers which have the initial memory location
|
||||
and are used only once }
|
||||
((ri_has_initial_loc in flags) and (weight<=200)) then
|
||||
if real_reg_interferences>=usable_registers_cnt then
|
||||
spillednodes.add(i);
|
||||
if spillednodes.length<>0 then
|
||||
begin
|
||||
@ -1706,6 +1699,15 @@ unit rgobj;
|
||||
for i:=selectstack.length downto 1 do
|
||||
begin
|
||||
n:=selectstack.buf^[i-1];
|
||||
{ Always spill the register if it has the initial memory location
|
||||
and is used only once (weight<=200). This allows to access the
|
||||
memory location directly, without preloading it to a register. }
|
||||
with reginfo[n] do
|
||||
if (ri_has_initial_loc in flags) and (weight<=200) then
|
||||
begin
|
||||
spillednodes.add(n);
|
||||
continue;
|
||||
end;
|
||||
{Create a list of colours that we cannot assign to n.}
|
||||
adj_colours:=[];
|
||||
adj:=reginfo[n].adjlist;
|
||||
|
Loading…
Reference in New Issue
Block a user