-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Set writable and dead_on_unwind attributes for sret arguments #121298
Conversation
ce4d7ea
to
5c66f83
Compare
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
Set writable and dead_on_unwind attributes for sret arguments Set the `writable` and `dead_on_unwind` attributes for `sret` arguments. This allows call slot optimization to remove more memcpy's. See https://llvm.org/docs/LangRef.html#parameter-attributes for the specification of these attributes. Fixes rust-lang#90595.
☀️ Try build successful - checks-actions |
This comment has been minimized.
This comment has been minimized.
Finished benchmarking commit (b47488b): comparison URL. Overall result: ❌✅ regressions and improvements - ACTION NEEDEDBenchmarking 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 a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)ResultsThis 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.
CyclesResultsThis 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 sizeResultsThis 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: 641.758s -> 639.466s (-0.36%) |
☔ The latest upstream changes (presumably #122050) made this pull request unmergeable. Please resolve the merge conflicts. |
Rebase & ping |
r? @cuviper |
Sound good! And for reference, I also found that you added this to Clang in llvm/llvm-project#77116. @bors r+ |
The problem on AArch64 is that SROA raises the alignment of an alloca when rewriting it: https://llvm.godbolt.org/z/szb1soPYs Because of that, we later no longer know that replacing the alloca with the (lower-aligned) sret parameter is legal. In this case the rewrite done by SROA is pretty spurious, and I think #122053 is going to avoid the issue by dint of directly using the type it rewrites to. I do wonder whether SROA really ought to be raising the alignment here... |
Set writable and dead_on_unwind attributes for sret arguments Set the `writable` and `dead_on_unwind` attributes for `sret` arguments. This allows call slot optimization to remove more memcpy's. See https://llvm.org/docs/LangRef.html#parameter-attributes for the specification of these attributes. In short, the statement we're making here is that: * The return slot is writable. * The return slot will not be read if the function unwinds. Fixes rust-lang#90595.
This comment has been minimized.
This comment has been minimized.
💔 Test failed - checks-actions |
@bors r- |
When compiled with -C panic=abort we'd generate an extra panic_cannot_unwind shim in the variant calling C-unwind.
Added missing needs-unwind annotation to the codegen test. @bors r=cuviper |
☀️ Test successful - checks-actions |
Finished benchmarking commit (284f94f): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countThis is a highly reliable metric that was used to determine the overall result at the top of this comment.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResultsThis 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 sizeResultsThis 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: 673.228s -> 670.551s (-0.40%) |
Set the
writable
anddead_on_unwind
attributes forsret
arguments. This allows call slot optimization to remove more memcpy's.See https://llvm.org/docs/LangRef.html#parameter-attributes for the specification of these attributes. In short, the statement we're making here is that:
Fixes #90595.