[PATCH] D30086: Add generic IR vector reductions

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 19 11:58:34 PDT 2017


aemerson updated this revision to Diff 95795.
aemerson added a comment.

I've finally got around to re-working this. Change summary:

- Addressed langref comments.
- Intrinsics are now experimental.
- The TTI interface has been split into two to give the min/max reductions a separate interface. I haven't split out the FP from int types because it doesn't really seem to give any benefit as the handling is very similar.
- A new SDNode type has been added to support fast-math flags on unary op nodes. Previously this was only supported for binary ops.
- The intrinsics for FP add/mul now take an additional scalar operand which should be undef if the reduction is a conventional "fast" reduction, otherwise it's the accumulator value for strict, i.e. ordered, reductions. CallInst fast-math flags are used to determine which semantics are wanted.
- The fmin/fmax intrinsics now use the fast-math flags to propagate NoNaN.

The separate lowering pass for these will come in a subsequent patch. For AArch64, my intention is to begin using these directly without using expansion however.


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/CodeGen/SelectionDAG.h
  include/llvm/CodeGen/SelectionDAGNodes.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/SelectionDAG.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.95795.patch
Type: text/x-patch
Size: 54275 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170419/e479d18d/attachment.bin>


More information about the llvm-commits mailing list