[llvm] ConstantFold logl calls (PR #94944)

Matthew Devereau via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 03:32:22 PDT 2024


MDevereau wrote:

> As far as I understand the difference between logl and llvm.log.f128 is that logl needs to set errno in the right places and has side-effects, llvm.log.f128 doesn't require that. That is why we convert logl to llvm.log.f128 under Ofast/-fno-math-errno. So `llvm.log.f128(0)` should still be fine to be constant-folded to Nan, it is only the logl calls that need to be more careful.

Makes sense, I've removed the checks for log.f128 then. With logl infinity, I was unsure whether the fact it hasn't retained the original logl call was correct behaviour or not.

https://github.com/llvm/llvm-project/pull/94944


More information about the llvm-commits mailing list