On 25/06/2019 20:28, denisgolovan wrote:
>> 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)
> 
> I am pretty sure LLVM is advanced enough to make that analysis itself for 
> primitive types.
> But what about something more interesting - arrays, matrices, trees, hash 
> tables, etc?

Complex types are built from primitive types. And if FPC can verify the
"pure" attribute is valid, then LLVM can probably also come up with it.
In fact, if FPC can verify it is valid, it can also come up with it
itself and add it as an annotation in the LLVM bitcode.


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to