-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Codegen units break #[inline(always)] at -O0 #45201
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
Comments
(I can work on this when I get a chance, just wanted to make sure you were aware) |
Why do we honor |
Yeah, I was thinking that |
@rkruppe sure yeah I can go into some more detail! So the problem with SIMD is that we actually need these functions to always get inlined to deal with ABI issues. Otherwise we have a function like: #[target_feature = "+avx"]
unsafe fn foo() {
let a = i16x16::new(...);
} So in this case In essence we rely on As for how we treat this at the LLVM layer, it's actually quite intentional that we always respect We have said many times before that @michaelwoerister AFAIK |
This commit updates the handling of `#[inline(always)]` functions at -O0 to ensure that it's always inlined regardless of the number of codegen units used. Closes rust-lang#45201
@alexcrichton Thanks for elaborating and, ouch, what a nasty problem! |
…ster rustc: Handle #[inline(always)] at -O0 This commit updates the handling of `#[inline(always)]` functions at -O0 to ensure that it's always inlined regardless of the number of codegen units used. Closes #45201
On the current nightly using multiple codegen units breaks #[inline(always)] in debug mode (as they could show up in different codegen units, preventing inlining). We should still treat #[inline(always)] as inline everywhere!
The text was updated successfully, but these errors were encountered: