[llvm] [ConstantFolding] Fold vector reduce `fmax` and `fmin` intrinsics (PR #143904)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 12 23:46:31 PDT 2025


dtcxzyw wrote:

> > Do we are about SNANs in the default FP environment?
> 
> Yes, you must for minnum and maxnum because it's a total value change, not a question of quiet or not

minimum/maximum propagate NaN. It is always safe to fold `llvm.vector.reduce.fminimum/fmaximum`.
For `llvm.vector.reduce.fmin/fmax`, we only perform the fold when nnan is present. Is that OK?


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


More information about the llvm-commits mailing list