[all-commits] [llvm/llvm-project] 5616ad: [NVPTX] Lower nvvm.fmax to maximumnum not maxnum (...

Lewis Crawford via All-commits all-commits at lists.llvm.org
Wed Apr 8 04:45:50 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 5616ad71697e3ef2ab97a937250e9193eee5713d
      https://github.com/llvm/llvm-project/commit/5616ad71697e3ef2ab97a937250e9193eee5713d
  Author: Lewis Crawford <lcrawford at nvidia.com>
  Date:   2026-04-08 (Wed, 08 Apr 2026)

  Changed paths:
    M llvm/lib/Analysis/ConstantFolding.cpp
    M llvm/lib/Target/NVPTX/NVPTXTargetTransformInfo.cpp
    M llvm/test/CodeGen/NVPTX/math-intrins-sm80-ptx70-instcombine.ll
    M llvm/test/Transforms/InstCombine/NVPTX/nvvm-intrins.ll

  Log Message:
  -----------
  [NVPTX] Lower nvvm.fmax to maximumnum not maxnum (#189976)

Converting nvvm.{fmin/fmax} into llvm.{min/max}num is slightly
incorrect, as {min/max}(a, sNaN) should produce "a" according to the PTX
spec, but LLVM's {min/max}num intrinsics may return either NaN or "a".

Use the {min/max}imumnum intrinsics instead for correct sNaN behaviour.

Also tidy up NVVM FMin/FMax constant-folding using these tighter
definitions of how the NVVM intrinsics map to {min/max}imum and
{min/max}imumnum.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list