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

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Sep 11 11:20:31 PDT 2021


dmgreen created this revision.
dmgreen added reviewers: spatel, nikic, fhahn, Ayal, david-arm.
Herald added a subscriber: hiraditya.
dmgreen requested review of this revision.
Herald added a project: LLVM.

This extends the reduction logic in the vectorizer to handle intrinsic versions of min and max, both the floating point variants already created by instcombine under fastmath and the integer variants from D98152 <https://reviews.llvm.org/D98152>.

As a bonus this allows it to match a chain of min or max operations into a single reduction, similar to how add/mul/etc work.


https://reviews.llvm.org/D109645

Files:
  llvm/include/llvm/Analysis/IVDescriptors.h
  llvm/lib/Analysis/IVDescriptors.cpp
  llvm/test/Transforms/LoopVectorize/minmax_reduction.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109645.372078.patch
Type: text/x-patch
Size: 14444 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210911/c8ac5fcf/attachment.bin>


More information about the llvm-commits mailing list