[llvm] [NVPTX] Constant fold NVVM fmin and fmax (PR #121966)

Lewis Crawford via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 06:53:55 PST 2025


LewisCrawford wrote:

I believe the issue with auto-upgrading these (even the ones without ftz/xorsignabs/nan modifiers) is that the semantics are slightly different than the existing `llvm.minnum` and `llvm.minimum intrinsics`.

`nvvm.fmin` maps to `minimumNumber` from IEEE754:2019 (it guarantees -0 < +0, and if either operand is a NaN it returns the other operand). It seems like support for this was recently added to LLVM's libc in https://github.com/llvm/llvm-project/pull/86016 , but there is not support for it with an LLVM IR intrinsic yet.

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


More information about the llvm-commits mailing list