[PATCH] D87391: [Intrinsics] define semantics for experimental fmax/fmin vector reductions

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 9 10:17:52 PDT 2020


spatel added inline comments.


================
Comment at: llvm/lib/CodeGen/ExpandReductions.cpp:163
+              cast<FixedVectorType>(Vec->getType())->getNumElements()) ||
+          !FMF.isFast())
         continue;
----------------
nikic wrote:
> Would it be sufficient to only check nnan here, or does the expansion rely on something more?
It's not safe currently.

llvm::createMinMaxOp() always creates instructions that are fully 'fast':
  // We only match FP sequences that are 'fast', so we can unconditionally
  // set it on any generated instructions.

And I think we are seeing that bug manifested in PR35538.


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

https://reviews.llvm.org/D87391



More information about the llvm-commits mailing list