Link-time optimization
Link-time optimization is a type of program optimization performed by a compiler to a program at link time. Link time optimization occurs in programming languages that compile programs on a file-by-file basis (such as C and Fortran), rather than all at once (such as Java[citation needed]).
Once all files have been compiled separately into object files, a compiler links (merges) the object files into a single file, the executable. As it is in the process of doing this (or immediately thereafter) a compiler with link-time optimization capabilities can apply various forms of interprocedural optimization to the newly merged file. The process of merging the files may have removed the knowledge limitations that occurred in the earlier stages of compilation, allowing for deeper analysis, more optimization, and ultimately better program performance.
External links
- LinkTimeOptimization branch on GCC wiki
- LLVM Link Time Optimization in LLVM
- Link-time Code Generation in Visual C++