NilFoundation / zkllvm-rslang

Other
15 stars 2 forks source link

Use `--only-needed` option for llvm-link to decrease output size #33

Closed aleasims closed 1 year ago

aleasims commented 1 year ago

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.