-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Various refactors to the LTO handling code (part 2) #144062
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
base: master
Are you sure you want to change the base?
Conversation
The modules vec can already contain serialized modules and there is no need to distinguish between cached and non-cached cgus at LTO time.
It isn't used anywhere. Also inline free_worker into the only call site.
Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_codegen_gcc |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
0044549
to
7026d08
Compare
This comment has been minimized.
This comment has been minimized.
bab46eb
to
217e5de
Compare
This comment has been minimized.
This comment has been minimized.
looked through all the commits and while they look good to me, I don't feel comfortable actually judging these changes, so r? compiler |
@@ -355,23 +356,28 @@ impl WriteBackendMethods for GccCodegenBackend { | |||
|
|||
fn run_and_optimize_fat_lto( | |||
cgcx: &CodegenContext<Self>, | |||
// FIXME(bjorn3): Limit LTO exports to these symbols |
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.
What does this mean exactly?
Does that mean that only those symbols should be exported?
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.
Yes. This is a superset of the set of symbols that will be exported by the linker (it also includes #[used]
symbols to ensure those are kept by LTO). By already marking the rest as non-exported during LTO, LTO can optimize non-exported functions more aggressively. For example by changing their ABI or dropping them entirely if unused.
And move exported_symbols_for_lto call from backends to cg_ssa.
Since lcnr's review I've moved the checks for if LTO is allowed to happen right before LTO is done rather than when the coordinator thread starts. This way it doesn't happen for Also give than this makes the symbol filtering always happen: @bors2 try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Various refactors to the LTO handling code (part 2) Continuing from #143388 this removes a bit of dead code and moves the LTO symbol export calculation from individual backends to cg_ssa.
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (f1a7db9): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -5.0%, secondary 1.0%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary -1.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 464.659s -> 464.118s (-0.12%) |
Continuing from #143388 this removes a bit of dead code and moves the LTO symbol export calculation from individual backends to cg_ssa.