Simplify sinh(x) / cosh(x) -> tanh(x) with fast-math
It seems that the simplification sin(x) / cos(x) -> tan(x) has been already implemented, but the same applies for hyperbolic function(s).
https://godbolt.org/z/WqYfKxr7K
For those who are interested in floating-point arithmetic optimization, I think this can be added to https://github.com/llvm/llvm-project/issues/34959.
Hey is anyone working on this ? If not could someone assign this to me ?
No one's replied till now (5 days since issue filing), so I'll assume no one has picked this up.
#77799 also related
Thanks for assigning me, I will look into this as soon as possible
I am almost done with this but there is one thing I can't quite figure out. I used replaceInstUsesWith to replace the div Instruction with a call Instruction to tanh. This does not replace the calls to sinh and cosh but when looking at the optimization of sin/cos it seems to replace the calls to sin and cos, why is this and how can I delete the calls to sinh and cosh ?
Any help would be appreciated.
it seems to replace the calls tosinandcos, why is this and how can I delete the calls tosinhandcosh` ? Any help would be appreciated.
The replaceInstUsesWith only replaces the uses, leaving behind the dead call instructions. You need to separately erase them