mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 18:29:13 +02:00
Changed ARMs StrLdr2StrMov peephole optimizer look further ahead
StrLdr2StrMov now uses GetNextInstructionUsingRef to find an instruction which uses the same Reference. In one of our internal testcases it speeded up a function by 15% as fpc generated a lot of spilling. git-svn-id: trunk@28344 -
This commit is contained in:
parent
bfa85218fa
commit
7e22bd53b6
@ -634,10 +634,13 @@ Implementation
|
|||||||
}
|
}
|
||||||
if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
|
if (taicpu(p).oper[1]^.ref^.addressmode=AM_OFFSET) and
|
||||||
(taicpu(p).oppostfix=PF_None) and
|
(taicpu(p).oppostfix=PF_None) and
|
||||||
GetNextInstruction(p,hp1) and
|
(taicpu(p).condition=C_None) and
|
||||||
MatchInstruction(hp1, A_LDR, [taicpu(p).condition, C_None], [PF_None]) and
|
GetNextInstructionUsingRef(p,hp1,taicpu(p).oper[1]^.ref^) and
|
||||||
RefsEqual(taicpu(p).oper[1]^.ref^,taicpu(hp1).oper[1]^.ref^) and
|
MatchInstruction(hp1, A_LDR, [taicpu(p).condition], [PF_None]) and
|
||||||
(taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) then
|
(taicpu(hp1).oper[1]^.ref^.addressmode=AM_OFFSET) and
|
||||||
|
not(RegModifiedBetween(taicpu(p).oper[0]^.reg, p, hp1)) and
|
||||||
|
((taicpu(hp1).oper[1]^.ref^.index=NR_NO) or not (RegModifiedBetween(taicpu(hp1).oper[1]^.ref^.index, p, hp1))) and
|
||||||
|
((taicpu(hp1).oper[1]^.ref^.base=NR_NO) or not (RegModifiedBetween(taicpu(hp1).oper[1]^.ref^.base, p, hp1))) then
|
||||||
begin
|
begin
|
||||||
if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
|
if taicpu(hp1).oper[0]^.reg=taicpu(p).oper[0]^.reg then
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user