[vlc-devel] LTO Support for VLC source code!

Toralf Niebuhr vlc at niebuhrt.de
Mon Sep 27 08:15:49 CEST 2010


Am 27.09.2010 um 00:42 schrieb Måns Rullgård:

> Toralf Niebuhr <niebuhr at niebuhrt.de> writes:
> 
>> Am 25.09.2010 um 06:41 schrieb Rémi Denis-Courmont:
>> 
>>>  Hello,
>>> 
>>> On Friday 24 September 2010, xxcv wrote:
>>>> Hello All!!
>>>> 
>>>> Yesterday I succeeded in compilation VLC 1.1 Branch with new GCC 4.5
>>>> feature LTO -flto.
>>>> I was overwhelmed !!!
>>> 
>>> That's great... but what's lto anyway?
>> Link-Time optimization.
>> Its a more powerful technique the usual.
> 
> LTO is mainly useful on badly structured (usually C++) code with
> millions of tiny functions scattered across different files.  For
> well-structured applications, LTO as implemented in gcc can even be
> harmful.  This should come as no surprise to those familiar with the
> overall quality of gcc optimisations, particularly the more exotic
> ones.
I don't know for sure how this is implemented in GCC. But I do know that it is not harmful in LLVM, as it is only an additional optimization.
One of the most valuable optimizations is the power to optimize away virtual classes, since usually when you look at the whole code, it is clear what the correct class will be. You can even inline a virtual function call.
Another useful analysis that wouldn't be possible without LTO is Data-Structure-Analysis also implemented in LLVM. which can optimize well when used with Automatic-Pool-Allocation.

There are a lot more use cases that LTO can optimize, that result from standard code abstraction.

Toralf Niebuhr
> 
> -- 
> Måns Rullgård
> mans at mansr.com
> 
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> http://mailman.videolan.org/listinfo/vlc-devel




More information about the vlc-devel mailing list