[PATCH] D61802: [LoopVectorize] Enable float minmax reductions via instruction flag

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 12:28:10 PDT 2019


spatel added a comment.

In D61802#1501752 <https://reviews.llvm.org/D61802#1501752>, @nlw0 wrote:

> My main motivation is just enabling vectorization for "minimum" loops without requiring function attributes. I think having a focus might help ensure I can contribute something, and a small patch would be nice too. I'll gladly work on a larger issue if it's within my reach, though, or if turns out to be required.


No problem - I've been putting the underlying changes off for a while, so I'll try to make some progress now and cc you on those patches.

> Where can I find more information about the expected behavior of fcmp? I don't understand why signed zeros should be relevant, the resulting behavior should just be whatever is caused by fcmp, either ignoring them or not. And ignoring should be the default anyway from what I recall from IEEE-754. Anyway, isn't this test here just about the fact NaNs violate associativity?

Yes, you're correct that fcmp should ignore signed zeros based on IEEE-754, and that's part of the problem: currently, we use 'nsz' on an fcmp to predicate at least 1 transform (that's PR38086).
That is relevant to this patch because FP min/max via select also violate associativity with signed zeros, but we're not accounting for that currently. We could ignore that as an existing bug and move ahead with this patch if it's urgent, but I'd rather try to fix this properly.

> Why would select take a flag, isn't the whole semantics encoded in the boolean returned from fcmp?

I think it would be better to discuss more general questions in PR38086 or 1 of the related bugs or on llvm-dev.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61802





More information about the llvm-commits mailing list