5

Build `rustc` with a single CGU on x64 Linux by Kobzol · Pull Request #115554 ·...

 11 months ago
source link: https://github.com/rust-lang/rust/pull/115554
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Contributor

@Kobzol Kobzol

commented

Sep 5, 2023

edited

This PR adds the rust.codegen-units=1 setting when compiling the 64-bit Linux rustc artifact (the one used for try builds and Linux rustup distribution). This had mixed results in the past, however after the bump to LLVM 17, the results now seem pretty incredible. Instruction counts, cycles, wall time, max RSS and even artifact sizes see large improvements.

The last try build with this setting took 1h 8m, which is basically the same duration for try builds that we have seen recently. So there shouldn't be any large hit to CI/build time.

I hope that this could potentially also reduce codegen noise of rustc a little bit, since small changes within a single rustc crate should no longer perturb optimizations because of CGU movement. We still do cross-crate LTO, so it won't eliminate it though.

r? @Mark-Simulacrum


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK