[PATCH] D151482: [LV] Add support for minimum/maximum intrinsics

Anna Thomas via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 19 08:27:36 PDT 2023

anna added a comment.
Herald added a subscriber: artagnon.

Thanks @dmgreen. Will add the test and update the missing intrinsics in the `getMinMaxReductionPredicate ` API.

Comment at: llvm/lib/Analysis/IVDescriptors.cpp:808
       return isSelectCmpPattern(L, OrigPhi, I, Prev);
+    auto HasRequiredFMF = [&]() {
+     if (FuncFMF.noNaNs() && FuncFMF.noSignedZeros())
dmgreen wrote:
> I'm not sure that minnum would require nnan and nsz to convert to a vector.reduce.fmin intrinsic. That might come from it matching select/fcmp, and sounds like a separate issue though.
You might be right here. NaN is propagated with a different logic (compared to minimum) and signed zero is ignored. However, note that the recurKind used by select/fcmp and the fmin intrinsic is the same. 

However, I've left the code as it was before for minnum/maxnum, so this can be addressed separately (along with tests added to make sure reduce.fmin lowers correctly without nnan flags?)

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list