[fpc-devel] Vectorisation, optimisation etc.

Jonas Maebe jonas at freepascal.org
Sun Apr 7 11:05:04 CEST 2019

On 2019-04-07 03:25, Ben Grasset wrote:

> Even the fact that FPC will not / cannot inline "procedure variable" 
> calls is far from great. Just that alone would result in enormous 
> speedups in a huge amount of places...

I'm sure there is code where that is the case, but I very much doubt 
this particular functionality would help with most code out there. E.g., 
if I enable FPC's whole-program devirtualisation on the compiler so that 
it tries to turn as many virtual calls into direct calls, and then feed 
the result to LLVM (so it can inline all of those previously indirect 
calls), the result is barely faster than the original code (it is quite 
a bit smaller though).

This is in spite of the fact that e.g. all of the originally virtual 
AfterConstruction and BeforeDestruction calls get removed completely 
(since they're empty), and quite a bit of the code generator, register 
allocator and node tree methods also get devirtualised.

Again, I'm sure there are programs where it does make a big difference, 
but I don't think the suggestion that this would help in "a huge amount 
of places" is correct in the general case.


More information about the fpc-devel mailing list