-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use ICF (identical code folding) for building rustc #99062
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,8 @@ ENV RUST_CONFIGURE_ARGS \ | |
--set target.x86_64-unknown-linux-gnu.ranlib=/rustroot/bin/llvm-ranlib \ | ||
--set llvm.thin-lto=true \ | ||
--set llvm.ninja=false \ | ||
--set rust.jemalloc | ||
--set rust.jemalloc \ | ||
--set rust.use-lld=true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This only affects Linux; is that intentional? Or should we use lld on other Unix platforms too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indeed I wanted to only try it first for Linux x64, as the most common toolchain. I usually test CI compilation optimization flags and similar things for it first, since it tends to have the best support. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm guessing this option wouldn't work on windows anyway as we don't use a single section per function there because COFF has a 2^16 - something limit on the section count and it is rather easy to hit this limit if every function has it's own section. |
||
ENV SCRIPT ../src/ci/pgo.sh python3 ../x.py dist \ | ||
--host $HOSTS --target $HOSTS \ | ||
--include-default-paths \ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is specific to the compiler; it doesn't affect tools or the standard library. Is that intentionall?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My main motivation was to try to reduce the size of
librustc_driver
, the largest dynamic library. But we can also try it forlibstd
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icf=all
is a bit zealous, should besafe
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In my experiments, safe didn't really do anything in terms of binary size. But we can try it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#99455 let's see :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
icf=safe
doesn't improve binary sizes at all, sadly. There are still nice cycle wins, but these come mostly from usinglld
.