Link time optimization in D
Adam Ruppe
destructionator at gmail.com
Tue Jun 1 10:10:25 PDT 2010
On 6/1/10, Michiel Helvensteijn <m.helvensteijn.remove at gmail.com> wrote:
> Walter Bright wrote:
>
>> The link-time optimization is essentially compiling the whole project
>> anyway,
>
> That makes no sense.
In simple terms, that is what it is though!
http://gcc.gnu.org/wiki/LinkTimeOptimization
"Link Time Optimization (LTO) gives GCC the capability of dumping its
internal representation (GIMPLE) to disk, so that all the different
compilation units that make up a single executable can be optimized as
a single module."
The -lto option dumps gcc's internal data into the object file, so
when it is called again, it can reload it, as if it had just created
it from the source.
> You save time by recompiling only files that have changes.
But, then the whole program goes through the process again anyway to
perform the optimization. You save a little time in skipping parts of
the front end for unchanged file, but the whole backend process has to
happen anyway.
> More importantly, what if you only have access to the object files?
Unless you make those object files with the special -lto switch, you
still don't get the benefit.
More information about the Digitalmars-d
mailing list