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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 24 07:08:52 PST 2019


spatel added a comment.

In D61802#1795463 <https://reviews.llvm.org/D61802#1795463>, @xbolva00 wrote:

> > But checking for nsz should happen on the 'select' rather than the 'fcmp'. I think we should fix the fundamental problems in the IR itself instead of trying to hack around them any more.
>
> This is solved.


It's true that we now allow FMF on select and phi, but this example shows that we're still a long way from deprecating FMF on fcmp. The IR in these tests matches something like this in C source:

  float f(float *p) {
    float min = p[0];
    for (unsigned i=0; i<65537; ++i)
      if (p[i] < min) min = p[i];
    return min;
  }

When that begins life as IR in clang, there are no select or phi instructions, so existing FMF propagations are never even exercised. We will need to allow FMF on loads and arguments (effectively any FP value) to make this work without using any function attributes.


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