-
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
Mark all extern functions as nounwind #28358
Conversation
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
Thanks @dotdash! I'm excited to see how this plays out. Some thoughts of mine:
|
☔ The latest upstream changes (presumably #28306) made this pull request unmergeable. Please resolve the merge conflicts. |
494e66b
to
be96d9f
Compare
Added codegen tests for the attributes, but not for the call (as discussed on IRC) because we never use invoke an external functions anyway. Also removed the check for nounwind in invoke() because that's for rust functions only, and they don't get marked nounwind yet. |
Looks good to me, thanks! Can you also mark the |
@bors r=alexcrichton bd6da30 |
⌛ Testing commit bd6da30 with merge 21ba40d... |
💔 Test failed - auto-win-msvc-64-opt |
@bors retry I'm confused about this error... |
⌛ Testing commit bd6da30 with merge dcf66cb... |
💔 Test failed - auto-win-msvc-64-opt |
Unwinding across an FFI boundary is undefined behaviour, so we can mark all external function as nounwind. The obvious exception are those functions that actually perform the unwinding.
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/
💔 Test failed - auto-win-msvc-64-opt |
@bors retry At least it hit a known intermittent failure this time... |
⚡ Previous build results for auto-win-msvc-32-opt are reusable. Rebuilding only auto-linux-32-nopt-t, auto-linux-32-opt, auto-linux-64-nopt-t, auto-linux-64-opt, auto-linux-64-x-android-t, auto-mac-32-opt, auto-mac-64-nopt-t, auto-mac-64-opt, auto-win-gnu-32-nopt-t, auto-win-gnu-32-opt, auto-win-gnu-64-nopt-t, auto-win-gnu-64-opt, auto-win-msvc-64-opt... |
This allows to skip the codegen for all the unneeded landing pads, reducing code size across the board by about 2-5%, depending on the crate. Compile times seem to be pretty unaffected though :-/