Is there a reason why not to use link-time optimization (LTO)?

后端 未结 5 1218
暖寄归人
暖寄归人 2020-12-05 06:31

GCC, MSVC, LLVM, and probably other toolchains have support for link-time (whole program) optimization to allow optimization of calls among compilation units.

Is the

5条回答
  •  萌比男神i
    2020-12-05 06:38

    This recent question raises another possible (but rather specific) case in which LTO may have undesirable effects: if the code in question is instrumented for timing, and separate compilation units have been used to try to preserve the relative ordering of the instrumented and instrumenting statements, then LTO has a good chance of destroying the necessary ordering.

    I did say it was specific.

提交回复
热议问题