Hey @mw , where can I go to learn more about the whole crate graph LTO that you mentioned in the meeting?
Isn't that just
-C lto=thin? Though
C lto=fat would also count I guess
i got the impression from @mw that there were two kinds of thin LTO
So, there is "local" ThinLTO which does ThinLTO just among the object files of the _current_ crate
and then there is crate graph ThinLTO which (like "fat" LTO) pulls in the LLVM bitcode of upstream crates too
if you don't specify
-C lto and compile with multiple codegen units then local ThinLTO will be used
if you compile with just one CGU, then local ThinLTO makes no sense, so no ThinLTO is performed at all
-C lto=thin will get you whole-crate-graph ThinLTO
-C lto=thinwill get you whole-crate-graph ThinLTO
so there's no way to explicitly encode the behavior that we get by default?
I was doing
-C lto=thin thinking that yielded something equivalent to our default when i had multiple codegen units.
but it sounds like you are saying that is false?
let me go look at my results again
yes, there is no way to force the default behavior via
this is where the decision is made: https://github.com/rust-lang/rust/blob/237bf3244fffef501cf37d4bda00e1fce3fcfb46/src/librustc/session/mod.rs#L558-L625
-Z thinlto seems to let you force local ThinLTO