[llvm] [LangRef] Clarify specification for float min/max operations (PR #172012)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 22 01:53:57 PST 2025


nikic wrote:

> At least, it should be done in order:

This is why this patch documents that the intrinsics have ordered zero behavior, but includes a warning that this behavior has not been implemented yet.

This will allow people to actually start working on making that a reality without getting bogged down in the 10th discussion on this topic, while at the same time making it clear that you can't rely on this *yet*.

Of course, if we want to actually make optimizations that involve dropping the nsz flag, we need to be careful about what the performance effect would be on targets that don't support that natively. I did find @valadaptive's point that `maxnum(x, 0.0)` in particular admits an efficient X86 lowering even without nsz quite interesting -- that would make the performance argument for that case simpler.

(I really don't want this thread to get bogged down in discussions of a specific potential optimization -- it was only mentioned as an example that maxnum without nsz can have practical application even if frontends don't emit it directly.)

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


More information about the llvm-commits mailing list