-
Notifications
You must be signed in to change notification settings - Fork 13.8k
Avoid LocalCopy
instantiation for #[inline]
on -Copt-level=0
#147351
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?
Avoid LocalCopy
instantiation for #[inline]
on -Copt-level=0
#147351
Conversation
Because it is not really helpful to have downstream instantiations that we won't inline anyways (`*`) `*` This is not quite true when `#[inline]` is being used as effectively `#[likely_unused]`
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt |
r? @fee1-dead rustbot has assigned @fee1-dead. Use |
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
…=<try> Avoid `LocalCopy` instantiation for `#[inline]` on `-Copt-level=0`
This comment has been minimized.
This comment has been minimized.
The job Click to see the possible cause of the failure (guessed by this bot)
|
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (85bd5e8): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking 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. Next Steps: If you can justify the regressions found in this try perf run, please do so in sufficient writing along with @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 2.0%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 52.9%, secondary 5.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 7.6%, secondary 14.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 471.44s -> 471.725s (0.06%) |
The change improves full builds of binaries. We don't have very many of those in the benchmark suite. The 897% change is an incr-patched benchmark, you probably angered the CGU merging gods and need to do the strategy I explained in this PR: #145910. There are some other libraries that regress, and those are pretty easy to hand-wave away as needing to codegen more items. I think the rest of the changes which seem like relatively random perturbations to library build times, are just because we use instantiation modes as an unprincipled caching system that crate authors are not actively trying to take advantage of, so if you perturb the rules for what gets LocalCopy, some crates benefit and some regress. |
We also need to address how this likely undoes some of the wins from #117727 (comment) |
stdarch depends on |
stdarch should be using an attribute that's designed for that purpose. |
Because it is not really helpful to have downstream instantiations that we won't inline anyways (
*
)*
This is not quite true when#[inline]
is being used as effectively#[likely_unused]
Let's check the performance impact of just doing this without any more thinking about anything