[PATCH] D109645: [LV] Recognize intrinsic min/max reductions

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 13 12:19:48 PDT 2021


spatel added a comment.

I didn't realize we were still missing vectorization of these intrinsics. What is the difference between the patterns here vs. the tests that are already vectorized in llvm/test/Transforms/LoopVectorize/intrinsic.ll ?



================
Comment at: llvm/include/llvm/Analysis/IVDescriptors.h:135
+  /// instruction, so its corresponding cmp can be matched to it.
+  static InstDesc isMinMaxSelectCmpPattern(Instruction *I, RecurKind Kind,
                                            const InstDesc &Prev);
----------------
Should this be called "isMinMaxPattern" now since it matches both intrinsics and select-cmp?


================
Comment at: llvm/test/Transforms/LoopVectorize/minmax_reduction.ll:998
   %0 = load float, float* %arrayidx, align 4
   %1 = tail call fast float @llvm.maxnum.f32(float %s.011, float %0)
   %inc = add nuw nsw i32 %i.012, 1
----------------
Either this test or the previous one could be just "nnan nsz" rather than "fast" so we are testing the minimum FMF (assuming that works as expected).


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

https://reviews.llvm.org/D109645



More information about the llvm-commits mailing list