-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
perf experiment: remove noalias, readonly, dereferenceable attributes #137707
Conversation
@bors try |
This comment has been minimized.
This comment has been minimized.
perf experiment: remove noalias, readonly, dereferenceable attributes We sometimes get claims that these attributes aren't worth it, e.g. in a current discussion on the LKML. Let's see if we can get useful evidence just with the compiler test suite. I hope I got the diff right.^^ Cc `@Darksonn` `@ojeda` `@saethlin` `@nikic`
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (8d95477): comparison URL. Overall result: ❌✅ regressions and improvements - please read the text belowBenchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf. Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @bors rollup=never Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (primary 0.5%, secondary -0.7%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (primary -0.5%, secondary -0.0%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary -0.0%, secondary -1.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 770.531s -> 759.113s (-1.48%) |
The compiler does less work, so many compilation sessions getting faster is expected. Some getting slower means that the optimization really kicked in there, but it's not a slam-dunk result. Even some runtime benchmarks get faster, which is... quite surprising? |
Yeah, the runtime ones are quite surprising, especially considering it is supposed to include not just |
I would look at cycles/walltime for the runtime benchmarks for such a change. The raytracer benchmark got a 15% regression, which is well above its noise limit. But this change would be better examined on a better range of runtime benchmarks than the small set we have on rustc-perf. |
You can look at IIRC some issues that users filed where noalias was a benefit were often compute kernels running over multiple slices that vectorized better when the backend knows they don't alias. rustc probably is too branchy for that particular benefit. |
In #121068 I found that that only emitting So I'm only a little surprised by this perf report. I suspect there are code paths in LLVM where checks are written too strictly and just fail to apply when attributes are present. It would be great to minimize some of these regressions. |
I can reproduce the wall time regression for the raytracer benchmark locally, but I can't find any difference in the generated code for the hottest functions. Strange... |
could be a function layout thing |
I am not even sure what you mean by that. If this were caused by something like getting a lucky/unlucky address for some important instructions we would expect to see fluctuations of this magnitude all the time and we don't. |
Yeah I did mean function address layout, which is known to be prone to causing perf differences. But you are right that this would happen more often if it made that big of a difference. |
We sometimes get claims that these attributes aren't worth it, e.g. in a current discussion on the LKML. Let's see if we can get useful evidence just with the compiler test suite. I hope I got the diff right.^^
Cc @Darksonn @ojeda @saethlin @nikic