Link-time optimized technologies and patterns?

Connection time optimization (LTO) (aka build) is included in GCC 4.5 or later, and other compilers have similar optimization passes. Doesn't that make certain code codes more viable than before?

For example, for maximum performance, a β€œmodule” of C code often needs to expose its guts. Does LTO make this obsolete? What code templates are now more viable than before?

+4
source share
1 answer

I believe that LTO is just an optimization, but not necessarily one that eliminates the need for documentation on the implementation ("gut exposure") of any module. Entire languages ​​were written in it; I don't think C will have what needs to be removed from it anytime soon, or possibly sometime.

From the description of the LTO function in gcc :

Link Time Optimization (LTO) gives GCC the ability to flush its internal representation (GIMPLE) to disk, so that all the different compilation units that make up one executable file can be optimized as a single module. This broadens the scope of interprocedural optimization to cover the entire program (or, most likely, which is displayed during the connection).

From the declaration of including LTO in gcc :

The result should, in principle, be faster, but our cost IPA models are still not modified for LTO. We have seen accelerations as well as slowdowns in benchmarks (see LTO testers at http://gcc.opensuse.org/ ).

+2
source

Source: https://habr.com/ru/post/1379824/


All Articles