mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-13 17:59:09 +02:00
* x86: "MovMov2Mov 1" now removes the first instruction if the intermediate register is not in use afterwards.
This commit is contained in:
parent
4459510e5c
commit
6548dd0211
@ -4589,6 +4589,18 @@ unit aoptx86;
|
|||||||
DebugMsg(SPeepholeOptimization + 'MovMov2Mov 1',p);
|
DebugMsg(SPeepholeOptimization + 'MovMov2Mov 1',p);
|
||||||
RemoveInstruction(hp1);
|
RemoveInstruction(hp1);
|
||||||
Result:=true;
|
Result:=true;
|
||||||
|
|
||||||
|
if (taicpu(p).oper[1]^.typ = top_reg) then
|
||||||
|
begin
|
||||||
|
TransferUsedRegs(TmpUsedRegs);
|
||||||
|
if not RegUsedAfterInstruction(taicpu(p).oper[1]^.reg, p, TmpUsedRegs) then
|
||||||
|
begin
|
||||||
|
{ reg2 is no longer in use }
|
||||||
|
DebugMsg(SPeepholeOptimization + 'Mov2Nop 6 done',p);
|
||||||
|
RemoveCurrentP(p);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
exit;
|
exit;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user