[llvm] [IVDescriptors] Don't require nsz/nnan for (min|max)num. (PR #137003)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 11:36:56 PDT 2025
davemgreen wrote:
> > > For the vector-reduction case, we will need to generate one extra op to silence the NaN, as the reduction value is guaranteed no-snan, if the start value isnt' snan.
> >
> >
> > Do you have a motivating case? Does it look like `maxnum(reduct_iv, load)` or something more complex like `maxnum(reduct_iv, fp_op(..))`. With the second, if you know it is not snan, then I was wondering if it generating the reduction could still be valid.
>
> We should vectorize both, my motivating case is the first one. But even when using `maximumnum`, we should be able to lower `maximumnum(rdx_phi, fp_op()` to `fmaxnm` without anything else; We could also do that with `maxnum(reduct_iv, fp_op(..))`, but it gets a bit fuzzy and relies on nothing removing the `fp_op` later, which would make things incorrect again
Good point, yeah.
https://github.com/llvm/llvm-project/pull/137003
More information about the llvm-commits
mailing list