mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-15 06:29:38 +02:00
* improved detection of range of instructions which use a register
(merged from fixes branch)
This commit is contained in:
parent
debe8d1498
commit
5d7597c09f
@ -382,8 +382,12 @@ end;
|
|||||||
|
|
||||||
function FindRegDealloc(reg: tregister; p: pai): boolean;
|
function FindRegDealloc(reg: tregister; p: pai): boolean;
|
||||||
{ assumes reg is a 32bit register }
|
{ assumes reg is a 32bit register }
|
||||||
|
var
|
||||||
|
hp: pai;
|
||||||
|
first: boolean;
|
||||||
begin
|
begin
|
||||||
findregdealloc := false;
|
findregdealloc := false;
|
||||||
|
first := true;
|
||||||
while assigned(p^.previous) and
|
while assigned(p^.previous) and
|
||||||
((Pai(p^.previous)^.typ in (skipinstr+[ait_align])) or
|
((Pai(p^.previous)^.typ in (skipinstr+[ait_align])) or
|
||||||
((Pai(p^.previous)^.typ = ait_label) and
|
((Pai(p^.previous)^.typ = ait_label) and
|
||||||
@ -392,10 +396,21 @@ begin
|
|||||||
p := pai(p^.previous);
|
p := pai(p^.previous);
|
||||||
if (p^.typ = ait_regalloc) and
|
if (p^.typ = ait_regalloc) and
|
||||||
(pairegalloc(p)^.reg = reg) then
|
(pairegalloc(p)^.reg = reg) then
|
||||||
|
if not(pairegalloc(p)^.allocation) then
|
||||||
|
if first then
|
||||||
begin
|
begin
|
||||||
findregdealloc := not(pairegalloc(p)^.allocation);
|
findregdealloc := true;
|
||||||
break;
|
break;
|
||||||
end;
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
findRegDealloc :=
|
||||||
|
getNextInstruction(p,hp) and
|
||||||
|
regLoadedWithNewValue(reg,false,hp);
|
||||||
|
break
|
||||||
|
end
|
||||||
|
else
|
||||||
|
first := false;
|
||||||
end
|
end
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1155,7 +1170,11 @@ End.
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.4 2000-07-21 15:19:54 jonas
|
Revision 1.5 2000-08-04 20:08:03 jonas
|
||||||
|
* improved detection of range of instructions which use a register
|
||||||
|
(merged from fixes branch)
|
||||||
|
|
||||||
|
Revision 1.4 2000/07/21 15:19:54 jonas
|
||||||
* daopt386: changes to getnextinstruction/getlastinstruction so they
|
* daopt386: changes to getnextinstruction/getlastinstruction so they
|
||||||
ignore labels who have is_addr set
|
ignore labels who have is_addr set
|
||||||
+ daopt386/csopt386: remove loads of registers which are overwritten
|
+ daopt386/csopt386: remove loads of registers which are overwritten
|
||||||
|
Loading…
Reference in New Issue
Block a user