Byte Archives - Link Time Optimization
Byte Archives
Light Mode

Link Time Optimization

LTO One is a compiler optimization technique that allows for faster and more efficient code execution.

From Martins Mozeiko

Modern compilers do exactly the same optimizations at link time as they do at compile time. Specifically, they call the same code inside compiler/linker to do optimizations on IR + further levels.
For example, when clang compiles with LTO enabled, its .obj files are actually LLVM bytecode. The linker obviously cannot do with those anything to output machine code so it calls the compiler to optimize to lower level machine code.
MSVC and GCC does the same. The point of LTO is to offer better optimization possibilities. However, it's harder to multithread. With a compiler, it's trivial because you can do each TU individually.