[fpc-pascal] code optimization
florian at freepascal.org
Sun Sep 26 23:25:51 CEST 2010
Am 24.09.2010 15:36, schrieb Jonas Maebe:
> On 24 Sep 2010, at 14:35, Jonas Maebe wrote:
>> On 24 Sep 2010, at 11:48, Adrian Veith wrote:
>>> Register allocation is on a comparable level for both versions.
>> Delphi keeps the "Bar" pointer in a register, while FPC spills it to
>> the stack. Because Bar is used in most of the most-executed
>> statements, this has a huge impact.
> Correction: Delphi keeps the hidden parent frame pointer parameter in a
> register (which is required every time Bar is accessed), while FPC puts
> it on the stack. The end result is the same though: 1 extra memory
> access every time Bar or any other variable from the parent procedure is
I've almost a patch ready which should solve this. Furthermore, I
improved cse a little bit. Nevertheless, this safes only 5% on my
machine. Unfortunatly, I found no proper way to enable cse on dyn. array
expressions, this should help for another 5%.
Did anybody (Jonas?) profile which the real hot spot lines are?
More information about the fpc-pascal