PragmaTwice commented on PR #764:
URL: 
https://github.com/apache/incubator-kvrocks/pull/764#issuecomment-1203886464

   > I think we should add some descriptions for these options, why do we use, 
their advantage or disadvantages
   
   Link-time optimization (LTO) is an important optimization technology in 
modern compilers.
   
   As we already known, C/C++ compilers generate native object files for every 
translation unit (TU), which indicates compiler can only get information within 
a certain TU, i.e. it know nothing about another TU (except declarations). But 
obviously most compiler optimization approach requires the information in 
function definitions, like constant propagation, reachable analysis, 
interprocedual dataflow analysis, inlining, loop invariant analysis, pointer 
analysis, etc.
   
   So if compiler cannot retrieve such information, the optimization will be 
just discarded. Obviously, this is a huge loss. LTO postpone the optimization 
procedures to link-time so every definition in the program is available to the 
optimizer. I do not think LTO has any disadvantages other than possibly slowing 
down compilation.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to