mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-11-02 19:43:15 +01:00
* patch by Nico Erfurth: Check for register reloading in RegUsedAfterInstruction on ARM
This slightly changes the semantics of RegUsedAfterInstruction. We now check if the `current value` of the register will be used later. It will do `the right thing` for all the normal use cases. git-svn-id: trunk@21519 -
This commit is contained in:
parent
9636202165
commit
5b02a7cb9b
@ -190,10 +190,13 @@ Implementation
|
||||
begin
|
||||
AllUsedRegs[getregtype(reg)].Update(tai(p.Next));
|
||||
RegUsedAfterInstruction :=
|
||||
(AllUsedRegs[getregtype(reg)].IsUsed(reg)) and
|
||||
(not(getNextInstruction(p,p)) or
|
||||
instructionLoadsFromReg(reg,p) or
|
||||
not(regLoadedWithNewValue(reg,p)));
|
||||
AllUsedRegs[getregtype(reg)].IsUsed(reg) and
|
||||
not(regLoadedWithNewValue(reg,p)) and
|
||||
(
|
||||
not(GetNextInstruction(p,p)) or
|
||||
instructionLoadsFromReg(reg,p) or
|
||||
not(regLoadedWithNewValue(reg,p))
|
||||
);
|
||||
end;
|
||||
|
||||
procedure TCpuAsmOptimizer.RemoveSuperfluousMove(const p: tai; movp: tai; const optimizer: string);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user