3 ms·
I have always imagine LTO to be such a huge pandora's box regarding this type of issues (e.g. the removal of the impicit memory barrier between function calls)
by AshamedCaptain 4y ago
I have always imagine LTO to be such a huge pandora's box regarding this type of issues (e.g. the removal of the impicit memory barrier between function calls) that the fact that it isn't (e.g. many distributions enable lto by default) means that either these problems are way overblown or compilers are still keeping barriers between function calls internally.
- planede 4y agoCompilers definitely don't keep barriers between function calls internally. AFAIK LTO enables inlining as well, but inlining is not the only inter-procedural optimization that can happen.
- gpderetta 4y agobut LTO enables interproc optimizations between separate compilation units.
- MauranKilom 4y agoYes. OP should mention that they talk about "function calls (to functions defined in other translation units)", even though it's semi-implicit in mentioning LTO.