[PATCH] D137220: [LV][IVDescriptors] Fix recurrence identity element for FMin and FMax reductions.

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 2 14:36:49 PDT 2022


spatel added a comment.

> In D137220#3902612 <https://reviews.llvm.org/D137220#3902612>, @spatel wrote:
>
>> Should these be guarded with an FMF check?
>>
>> The enum definition says:
>>
>>   FMin,       ///< FP min implemented in terms of select(cmp()).
>>   FMax,       ///< FP max implemented in terms of select(cmp()).
>>
>> So if we have a NaN input:
>> fmin(NaN, Inf) --> select (fcmp olt NaN, Inf), NaN, Inf --> Inf (so the NaN input did not survive)
>
> Do you mean that identity value computation for FMin/FMax should be guarded with a `FMF.noNaNs()` check? What would be the identity value when the flag is absent?

Yes, I'm not sure what it means if we don't have FMF.noNaNs(). Is it possible to create this recurrence without that FMF? If not, can we assert that FMF.noNaNs() is set?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D137220/new/

https://reviews.llvm.org/D137220



More information about the llvm-commits mailing list