-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
Bad codegen after commit 3aae916 #92217
Comments
Bisected to EarlyCSE: https://godbolt.org/z/ejMhYfGzs
After:
computeKnownFPClass assumes that the square root of a value is always non-negative. |
See 7.2.1 Treatment of error conditions:
|
It is always non-negative, except for -0 |
See llvm-project/llvm/lib/Analysis/ValueTracking.cpp Lines 4930 to 4938 in 45726c1
|
The C definitions are unhelpful. It returns a NaN, as per IEEE |
IEEE Std 754-2019 IEEE Standard for Floating-Point Arithmetic:
I will post a fix. |
We have an internal test that recently started producing incorrect output which I bisected back to commit 3aae916.
Consider the following code:
If compiled with optimizations and
-mavx
and the resulting binary is run, the return value changes after 3aae916:You can also see the difference on godbolt comparing with 18.1.0:
https://godbolt.org/z/KPbK4jcGc
The text was updated successfully, but these errors were encountered: