[PATCH] D117450: [LoopInterchange] Support loop interchange with floating point reductions

Michael Kruse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 29 09:41:59 PST 2022


Meinersbur added a comment.

In D117450#3280681 <https://reviews.llvm.org/D117450#3280681>, @congzhe wrote:

> Thanks Michael, this is what I described as well (I updated my previous reply, just in case you did not notice: https://reviews.llvm.org/D117450#3272927).

Sorry, I missed that. Probably because I had the Phabricator page already loaded when you submitted the comment.

> Are you suggesting me to modify `RedDesc[followLCSSA(&PHI)].getExactFPMathInst() != nullptr` to something like `!RedDesc[followLCSSA(&PHI)].getFastMathFlags().isfast()` in `areOuterLoopExitPHIsSupported()`?

I suggest this in findInnerReductionPhi:

  if (RecurrenceDescriptor::isReductionPHI(PHI, L, RD)) {
    if (RD.needsExactFPMath())
      return nullptr;
    return PHI;
  }

It might be more fine-grained using `RD.getFastMathFlags()` and check against compiler flags (if `RecurrenceDescriptor` did not already take them into account). LoopVectorize has additional hints/compiler flags that act like -ffast-math just for vectorization.


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

https://reviews.llvm.org/D117450



More information about the llvm-commits mailing list