mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 12:59:24 +02:00
+ RegModifiedBetween
git-svn-id: trunk@22216 -
This commit is contained in:
parent
85765364ee
commit
ca5078f9cf
@ -91,6 +91,9 @@ unit aoptbase;
|
||||
|
||||
{ returns true if reg is used by any instruction between p1 and p2 }
|
||||
Function RegUsedBetween(reg: TRegister; p1, p2: tai): Boolean;
|
||||
|
||||
{ returns true if reg is modified by any instruction between p1 and p2 }
|
||||
function RegModifiedBetween(reg: TRegister; p1, p2: tai): Boolean;
|
||||
end;
|
||||
|
||||
function labelCanBeSkipped(p: tai_label): boolean;
|
||||
@ -255,6 +258,18 @@ unit aoptbase;
|
||||
end;
|
||||
|
||||
|
||||
Function TAOptBase.RegModifiedBetween(reg : TRegister;p1,p2 : tai) : Boolean;
|
||||
Begin
|
||||
Result:=false;
|
||||
while assigned(p1) and assigned(p2) and GetNextInstruction(p1,p1) and (p1<>p2) do
|
||||
if RegModifiedByInstruction(reg,p1) then
|
||||
begin
|
||||
Result:=true;
|
||||
exit;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
||||
{ ******************* Processor dependent stuff *************************** }
|
||||
|
||||
Function TAOptBase.RegMaxSize(Reg: TRegister): TRegister;
|
||||
|
Loading…
Reference in New Issue
Block a user