[llvm] [Transforms] Resolve FIXME: No Lowering of FNeg to FMul unless it is safe (PR #85252)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 15 01:16:07 PDT 2024


arsenm wrote:

> https://alive2.llvm.org/ce/z/Ki3Rf2
> 
> `nnan` is all you need :)

In this context, it's not simply doing this transform in isolation. It's being consumed by another canonicalizing operation. The problem is this is introducing a canonicalization, which doesn't matter if it's only used by operations that canonicalize the inputs. nnan would not be sufficient to introduce this, since operations may also do other bit pattern changing side effects (like denormal flush). Since this is consumed by a canonicalizing operation, it's either correct to always do (in the has one use case) (or it's wrong to ever do).

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


More information about the llvm-commits mailing list