-
Notifications
You must be signed in to change notification settings - Fork 289
revise #[inline(always)] vs #[inline] #340
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
FWIW this was already done for all the vendor intrinsics, and I think it'll work to just switch everything to |
So i've change all uses of #[inline(always)] to #[inline] in #338 |
I just ran into some issues relating to lack of inlining. In order to test the SHA extensions work, I've converted some C code to Rust (it's mostly just calls to SSE/SHA intrinsics). However, a couple of SSE intrinsics were not being inlined and caused a 2x slowdown relative to the original C code. I determined the lack of inlining by manually inspecting the generated assembly. Changing to
I'm using |
@jasondavies Thanks for the feedback. Could you tell us how are you compiling your code? Are you just using |
You can try that with |
Sorry, forgot to include that: yes, I'm using I tried |
Ok one final question, are you using If you are using the simd facilities via EDIT: we have had problems with inlining in the past, which is why everything used to be |
If intrinsics aren't being inlined it's almost for sure due to mismatched target features enabled on functions rather than |
+1 to what @alexcrichton said: if you call, for example, an AVX function from an SSE one, the AVX function will never be inlined. |
Ah, that could be it! I'm using |
Yes, that fixed it. Thanks! |
Awesome, good to know! |
With ThinLTO
#[inline(always)]
should not be necessary anymore, most of its uses can be just#[inline]
.The text was updated successfully, but these errors were encountered: