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
Those two functions should generate the same asm code:
#[inline(never)]fndoit_not_generic(a:f64) -> f64{letmut a = a;
do 1000000000.times{
a = a * a;}
a
}#[inline(never)]fndoit<N:Mul<N,N>>(a:N) -> N{letmut a = a;
do 1000000000.times{
a = a * a;}
a
}
But they dont (at least, when called with f64).
Asm code for doit (there is an explicit call to the multiplication function):
#8332 filed to address the lack of inlining, but apparently the generic version still has a bunch of nops that the normal version does not have. That seems weird to me. Let's check the assembly again once #8332 has landed.
With -Z lto, these two functions compile to essentially the exact same code. A lack of inlining on certain functions may be a problem, but specific bugs about them should be opened about the functions in question. Otherwise, there doesn't appear to be a fundamental bug here, so closing.
Those two functions should generate the same asm code:
But they dont (at least, when called with f64).
Asm code for
doit
(there is an explicit call to the multiplication function):Asm code for
doit_not_generic
(uses the machine instruction):The text was updated successfully, but these errors were encountered: