-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Inconsistency in sinh(const), cosh(const), and tanh(const) optimizations with -ffast-math #132503
Comments
@llvm/issue-subscribers-clang-codegen Author: None (k-arrows)
Consider the following test case.
https://godbolt.org/z/Ecd865P97
```cpp
#include <cmath>
double f1() { double f2() { double f3() {
|
Missing constant folding support for llvm.sinh/cosh. |
Hi! This issue may be a good introductory issue for people new to working on LLVM. If you would like to work on this issue, your first steps are:
If you have any further questions about this issue, don't hesitate to ask via a comment in the thread below. |
@llvm/issue-subscribers-good-first-issue Author: None (k-arrows)
Consider the following test case.
https://godbolt.org/z/Ecd865P97
```cpp
#include <cmath>
double f1() { double f2() { double f3() {
|
I would like to work on this. Any hints on where to start? |
@dtcxzyw hey, here are some of my findings:
I found |
Consider the following test case.
https://godbolt.org/z/Ecd865P97
The optimization results for
std::sinh(0.)
,std::cosh(0.)
, andstd::tanh(0.)
differ between-O1
and-O1 -ffast-math
. Specifically, when-ffast-math
is enabled,sinh(0.)
andcosh(0.)
are not folded into constants but instead call the corresponding library functions. This suggests that-ffast-math
is restricting optimization rather than enhancing it.The text was updated successfully, but these errors were encountered: