[llvm] [IVDescriptors] Don't require nsz/nnan for (min|max)num. (PR #137003)

Matt Arsenault via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 24 12:13:09 PDT 2025


arsenm wrote:

> 2. we can avoid the problem for the purposes of lowering C's fmax/fmin without no-honor-nans by multiplying by 1.0 before doing fmaxnm (the multiplication sends sNaN to qNaN, which will then be dropped when the other operand is a number).
> At the IR level, you’re right that’s a canonicalize.

I don't think we should be inserting canonicalize in the IR for this. You can switch to llvm.minimumnum + nsz to get ignored-signalingness behavior plus the fuzzy signed 0 handling of C fmin. In terms of usability, we mostly shouldn't use llvm.minnum other than it's handy in the lowering path for the common case of targets with the old style operations 


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


More information about the llvm-commits mailing list