[fpc-devel] optimizing the peephole optimizer?

Florian Klämpfl florian at freepascal.org
Wed Jan 22 22:22:24 CET 2014

Am 22.01.2014 00:06, schrieb Martin Frb:
> On 21/01/2014 21:20, Florian Klämpfl wrote:
>> Am 19.01.2014 18:01, schrieb Martin:
>>> In each of them GetNextInstruction(p, hp1) could be executed.
>>> If I counted correct, it can be called up to 6 times for each a_mov.
>>> On the other hand:
>>> - no code in this case block, is ever executed, if it does not succeed.
>>> - It will always be executed at least once
>>> So it would probably be better to have this once at the start of the
>>> A_MOV block.
>>> If that makes sense, I can check other blocks for similar issues.
>> I guess the idea is to catch typical code sequences in one go, see also
>> the comment in 1243:
>> { Next instruction is also a MOV ? }
> So then a patch would be accepted to move the check for
>    GetNextInstruction(p, hp1)
> to the start, and have one single such condition, in one IF block, that
> will contain all the others?

Might p not be changed by if blocks before?

More information about the fpc-devel mailing list