[fpc-devel] XML node dump feature
Jonas Maebe
jonas at freepascal.org
Tue Jun 25 20:06:52 CEST 2019
On 25/06/2019 10:19, denisgolovan wrote:
>> Can I have an example of "hoisting pure functions out of loops" that you
>> speak of?
>
> Sure.
> I mean something like following (completely artificial example):
>
> function PureFunc1: ...
> function F(arg: Integer): Integer;
> var s:Integer;
> begin
> s:=0;
> for i:=0 to 100 do
> s:=s+PureFunc(arg);
> Result:=s;
> end;
You don't need any kind of new source code constructs for optimizing
that. The LLVM backend can already do that; in the worst case, only when
LTO is enabled (in case the function is declared in another unit)
Jonas
More information about the fpc-devel
mailing list