[flang-commits] [flang] [flang] Fetch the initial reduction value from the input array. (PR #136790)

Slava Zakharin via flang-commits flang-commits at lists.llvm.org
Thu Apr 24 15:25:21 PDT 2025


vzakhari wrote:

Peter made a good point that we should return a NaN for all-NaNs case.  I think for MINLOC/MAXLOC this means that we return the position of the first unmasked NaN.

So I do not see how I can change my PR to make the code faster, in general.  For `nnan` case, though, I think we can always select +/-LARGEST, and we do not need to read the init value from the array.  That should provide cleaner/faster code for `-ffast-math` users.

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


More information about the flang-commits mailing list