[fpc-devel] Kit's ambitions!
florian at freepascal.org
Wed Jun 13 21:23:53 CEST 2018
Am 12.06.2018 um 23:45 schrieb nickysn at gmail.com:
> On Mon, 2018-06-11 at 21:07 +0100, J. Gareth Moreton wrote:
>> Thanks David,
>> I'm still learning some of the nuances of the Intel and AMD
>> processors, but most of it is just logical analysis. Admittedly my
>> main drive has been to shrink down the size of the binary, since
>> Delphi and Free Pascal have always been a little bit bloated in
>> comparison. Not that it is necessarily a bad thing, but saving space
>> without sacrificing performance can only be a good thing, especially
>> for those with limited bandwidth or for saving those few precious
>> bytes when burning files to a CD or DVD.
>> There have been a few instances in the compiled compiler (my main
>> test case) where an entire register is freed up due to my deep
>> optimisation, and that means the corresponding "push" and "pop" at
>> either end of the procedure can be removed (along with the
>> corresponding stack unwinding information), although I haven't
>> started programming that yet.
> Isn't it better to perform this optimization before register
> allocation. Then, when this happens, the corresponding "push" and "pop"
> wouldn't even be put by the compiler, because the register wouldn't
> have to be spilled.
Yes, this is what I already started once, a peephole optimizer pass being able to be run before register allocation
which executes in particular optimizations which reduce register usage.
More information about the fpc-devel