[llvm] Avoid maxnum(sNaN, x) optimizations / folds (PR #170181)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 1 22:32:16 PST 2025


phoebewang wrote:

> > As far as I am aware, optimizations involving constant sNaN should generally be edge-cases that rarely occur, so here should hopefully be very little real-world performance impact from disabling these optimizations.
> 
> I'm curious, do we want to keep these optimizations around if the target makes no distinction between signalling and non-signalling NaNs? AFAICT, sNaN makes no difference on NVIDIA GPUs, and never causes any traps or updates any flags.

X86 doesn't distinguish it either. We need either change the LangRef or change targets' implementation to match with it. But either way, the optimizations are worth well. We should bring it back once the controversy settled.

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


More information about the llvm-commits mailing list