mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-09-11 13:09:43 +02:00
* properly take care of register allocations between the first and second instruction for the FoldLea optimization
* check for ait_instruction after a GetNextInstruction function call * cosmetics git-svn-id: trunk@39983 -
This commit is contained in:
parent
7b7e4e4f66
commit
9805214d34
@ -2398,9 +2398,10 @@ unit aoptx86;
|
|||||||
(taicpu(hp2).oper[1]^.typ = top_ref) then
|
(taicpu(hp2).oper[1]^.typ = top_ref) then
|
||||||
begin
|
begin
|
||||||
CopyUsedRegs(TmpUsedRegs);
|
CopyUsedRegs(TmpUsedRegs);
|
||||||
|
UpdateUsedRegs(TmpUsedRegs,tai(p.next));
|
||||||
UpdateUsedRegs(TmpUsedRegs,tai(hp1.next));
|
UpdateUsedRegs(TmpUsedRegs,tai(hp1.next));
|
||||||
if (RefsEqual(taicpu(hp2).oper[1]^.ref^, taicpu(p).oper[0]^.ref^) and
|
if (RefsEqual(taicpu(hp2).oper[1]^.ref^,taicpu(p).oper[0]^.ref^) and
|
||||||
not(RegUsedAfterInstruction(taicpu(hp2).oper[0]^.reg,hp2, TmpUsedRegs))) then
|
not(RegUsedAfterInstruction(taicpu(hp2).oper[0]^.reg,hp2,TmpUsedRegs))) then
|
||||||
{ change mov (ref), reg
|
{ change mov (ref), reg
|
||||||
add/sub/or/... reg2/$const, reg
|
add/sub/or/... reg2/$const, reg
|
||||||
mov reg, (ref)
|
mov reg, (ref)
|
||||||
@ -2444,6 +2445,7 @@ unit aoptx86;
|
|||||||
(taicpu(hp1).oper[1]^.typ = top_reg)
|
(taicpu(hp1).oper[1]^.typ = top_reg)
|
||||||
) and (
|
) and (
|
||||||
GetNextInstruction(hp1, hp2) and
|
GetNextInstruction(hp1, hp2) and
|
||||||
|
(tai(hp2).typ=ait_instruction) and
|
||||||
(taicpu(hp2).opsize = S_Q) and
|
(taicpu(hp2).opsize = S_Q) and
|
||||||
(
|
(
|
||||||
(
|
(
|
||||||
|
Loading…
Reference in New Issue
Block a user