[llvm] LangRef: Clarify behaviors of nsz in fast math flag (PR #137567)

Andy Kaylor via llvm-commits llvm-commits at lists.llvm.org
Wed May 14 13:26:44 PDT 2025


andykaylor wrote:

> > It is a valid output, isn't it?
> 
> No. It's permitted to return either operand if they have mixed signs, but it does not permit returning a value that isn't either of the original inputs

I don't have any reason why any transformation would want to introduce -0 when none of the inputs were -0, but I don't understand why we need a special case where the sign of zero results is restricted. Or is the special case "calls to anything other than a min/max intrinsic, arithmetic instructions, select, and phi"? It's not clear to me from the proposed change what the rule is for "arithmetic instructions, select, and phi".

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


More information about the llvm-commits mailing list