[PATCH] D30086: Add generic IR vector reductions

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 17 04:00:20 PST 2017


aemerson created this revision.
Herald added a subscriber: mzolotukhin.

This patch adds IR intrinsics for horizontal vector reductions and allows targets to opt-in to using them instead of the log2 shuffle vector algorithm.

So far the reductions currently added are: int add, mul, and, or, xor, [s|u]min, [s|u]max, fp add, fmax, fmin.

The SLP and Loop vectorizers have the common code to do shuffle reductions factored out into LoopUtils, and now have a unified interface for generating reductions regardless of the preference of the target. LoopUtils now uses TTI to determine what kind of reductions the target wants to handle.

For CodeGen, basic legalization support is added. I have a follow up patch to begin using these new representations for AArch64 NEON once this implementation is finalised.


Repository:
  rL LLVM

https://reviews.llvm.org/D30086

Files:
  docs/LangRef.rst
  include/llvm/Analysis/TargetTransformInfo.h
  include/llvm/Analysis/TargetTransformInfoImpl.h
  include/llvm/CodeGen/ISDOpcodes.h
  include/llvm/IR/IRBuilder.h
  include/llvm/IR/Intrinsics.td
  include/llvm/Transforms/Utils/LoopUtils.h
  lib/Analysis/TargetTransformInfo.cpp
  lib/Analysis/VectorUtils.cpp
  lib/CodeGen/SelectionDAG/LegalizeTypes.h
  lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
  lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h
  lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
  lib/IR/IRBuilder.cpp
  lib/Transforms/Utils/LoopUtils.cpp
  lib/Transforms/Vectorize/LoopVectorize.cpp
  lib/Transforms/Vectorize/SLPVectorizer.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D30086.88870.patch
Type: text/x-patch
Size: 39291 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170217/e1569f8f/attachment.bin>


More information about the llvm-commits mailing list