-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
const-prop regression for Float^Int #45949
Comments
--- a/base/math.jl
+++ b/base/math.jl
@@ -42,7 +42,7 @@ end
# non-type specific math functions
-@inline function two_mul(x::Float64, y::Float64)
+@assume_effects :consistent @inline function two_mul(x::Float64, y::Float64)
if Core.Intrinsics.have_fma(Float64)
xy = x*y
return xy, fma(x, y, -xy) seems sufficient and should be valid. |
is this not getting marked consistent because have_fma isn't consistent? if so, that's annoying, but makes sense. |
I think so, yes. And I'm not quite clear whether it could be. But IIUC, both branches of |
Just a reminder that the docstring of
so I don't think marking as |
|
Oh, right. Seems I was confused, sorry for the noise. |
Can someone answer a technical question for me? I see the PR #46022 to resolve this issue and it involves a Barring that, couldn't we check |
the short answer is that that's not valid, but I don't think it will matter much because have_fma isn't going to be used a lot. |
Mentioned this in #45656 as well as a little discussion on discord.
It seems like when doing exponentiation with Float^Int as literals, the compiler used to precalculate that in 1.7, but in 1.8 it does not do that anymore (except for some small values).
So an example that is around 5 times slower in 1.8.0-rc1 compared to 1.7.3 for me is
where for 1.7.3 the llvm is simply
and for 1.8.0-rc1
The changes seems to have been made since it made the calculation faster, but I feel like it should hopefully work to have it both fast and have the compiler able to precalculate on literals?
The text was updated successfully, but these errors were encountered: