[fpc-pascal] Inlined functions from compiled units

Marco van de Voort fpc at pascalprogramming.org
Fri Jan 24 11:46:40 CET 2025


Op 24-1-2025 om 09:58 schreef Hairy Pixels via fpc-pascal:
> On Jan 24, 2025 at 2:01:09 PM, Sven Barth via fpc-pascal 
> <fpc-pascal at lists.freepascal.org> wrote:
>> When a function has inlining enabled (either explicit with the inline 
>> directive or implicit through AutoInline optimization) then in 
>> addition to generating its code to the object file (for direct calls) 
>> the node tree is stored in the PPU. And this node tree is then used 
>> for inlining the function.
>
> oh it’s in the PPU. Ok that makes sense. I guess that serves the same 
> purpose as the LTO system in other compilers. I was curious if this 
> was maybe something on the TOOD list or partially implemented. Thanks.

Slightly different. LTO afaik requires multiple compiles where the later 
build uses info from the earlier build.

The FPC implementation inlines if the unit-with-function-to-be-inlined  
was compiled before the unit that references the inline function. That 
is within the /same/ (single) build, but also has as disadvantage afaik 
that if it is NOT like that, it won't be inlined.



More information about the fpc-pascal mailing list