6

Avoid codegen for Result::into_ok in lang_start by Mark-Simulacrum · Pull Reques...

 2 years ago
source link: https://github.com/rust-lang/rust/pull/88988
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

Copy link

Member

Mark-Simulacrum commented 27 days ago

edited

This extra codegen seems to be the cause for the regressions in max-rss on #86034. While LLVM will certainly optimize the dead code away, avoiding it's generation in the first place seems good, particularly when it is so simple.

#86034 produced this diff for a simple fn main() {}. With this PR, that diff becomes limited to just a few extra IR instructions -- no extra functions.

Note that these are pre-optimization; LLVM surely will eliminate this during optimization. However, that optimization can end up generating more work and bump memory usage, and this eliminates that.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK