llvm-link --only-needed will produce only used code, cutting off most of unused std library for example.
This will dramatically decrease Rust codegen output sizes. E.g. now simple example compiles into IR of ~72000 lines, and with this option it will be reduced to only 190 lines (!!!).
This is essentially the solution to our old problem of large Rust outputs. Usually unused code is eliminated during linking by default, but llvm-link needs an explicit indication for that.
llvm-link --only-needed
will produce only used code, cutting off most of unusedstd
library for example.This will dramatically decrease Rust codegen output sizes. E.g. now simple example compiles into IR of ~72000 lines, and with this option it will be reduced to only 190 lines (!!!).
This is essentially the solution to our old problem of large Rust outputs. Usually unused code is eliminated during linking by default, but
llvm-link
needs an explicit indication for that.