mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 00:09:32 +02:00
rgobj: reduce compilation time of programs with long movelists
Reduces compilation time of webtbs/tw2242 for AArch64 with -O2 from 15 minutes to 10 seconds on my system. from 15 minutes to 10 seconds
This commit is contained in:
parent
e2ade64a1e
commit
a835d8b533
@ -1327,7 +1327,7 @@ unit rgobj;
|
||||
procedure trgobj.combine(u,v:Tsuperregister);
|
||||
|
||||
var adj : Psuperregisterworklist;
|
||||
i,n,p,q:cardinal;
|
||||
original_u_count, i,n,p,q:cardinal;
|
||||
t : tsuperregister;
|
||||
searched:Tmoveins;
|
||||
found : boolean;
|
||||
@ -1365,6 +1365,7 @@ unit rgobj;
|
||||
sort_movelist(reginfo[u].movelist);
|
||||
if assigned(reginfo[v].movelist) then
|
||||
begin
|
||||
original_u_count:=reginfo[u].movelist^.header.count;
|
||||
for n:=0 to reginfo[v].movelist^.header.count-1 do
|
||||
begin
|
||||
{Binary search the sorted part of the list.}
|
||||
@ -1385,7 +1386,9 @@ unit rgobj;
|
||||
begin
|
||||
{Linear search the unsorted part of the list.}
|
||||
found:=false;
|
||||
for i:=header.sorted_until+1 to header.count-1 do
|
||||
{ no need to search the instructions we've already added
|
||||
from v, we know we won't find a match there }
|
||||
for i:=header.sorted_until+1 to original_u_count-1 do
|
||||
if searched.id=data[i].id then
|
||||
begin
|
||||
found:=true;
|
||||
|
Loading…
Reference in New Issue
Block a user