You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My original finding is this perf report: rust-lang/rust#121417 (comment) which is based on a compiler diff that just makes #[inline(always)] not emit the LLVM attribute alwaysinline in unoptimized builds. LLVM will inline functions with alwaysinline even in unoptimized builds (I don't know if rustc sets up some specific pass list to make this happen).
And in optimized builds the always-inliner runs first, so #[inline(always)] on a function that will be inlined anyway may produce better optimizations. I believe we have examples of compiler performance fluctuations that certainly indicate this effect can produce different optimizations, which are sometimes better.
So I think what you really want is a cfg or a feature like you have in regex; the tripping hazard is that the compiler doesn't provide a way to change your attributes based on the optimization level.
The text was updated successfully, but these errors were encountered:
From rust-lang/rfcs#3711 (comment)
My original finding is this perf report: rust-lang/rust#121417 (comment) which is based on a compiler diff that just makes
#[inline(always)]
not emit the LLVM attributealwaysinline
in unoptimized builds. LLVM will inline functions withalwaysinline
even in unoptimized builds (I don't know if rustc sets up some specific pass list to make this happen).And in optimized builds the always-inliner runs first, so
#[inline(always)]
on a function that will be inlined anyway may produce better optimizations. I believe we have examples of compiler performance fluctuations that certainly indicate this effect can produce different optimizations, which are sometimes better.So I think what you really want is a cfg or a feature like you have in regex; the tripping hazard is that the compiler doesn't provide a way to change your attributes based on the optimization level.
The text was updated successfully, but these errors were encountered: