aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Transforms/Utils/LoopUtils.cpp
diff options
context:
space:
mode:
authorAmara Emerson <amara.emerson@arm.com>2017-05-10 09:42:49 +0000
committerAmara Emerson <amara.emerson@arm.com>2017-05-10 09:42:49 +0000
commit836b0f48c1162afc8158a4afa1833d4495033b2d (patch)
tree9d78dadccdf243c53faebfbc45a9600a8c4ad0c9 /llvm/lib/Transforms/Utils/LoopUtils.cpp
parent44800c5aba905d6b736b03495948769e9bc9bef5 (diff)
downloadllvm-836b0f48c1162afc8158a4afa1833d4495033b2d.zip
llvm-836b0f48c1162afc8158a4afa1833d4495033b2d.tar.gz
llvm-836b0f48c1162afc8158a4afa1833d4495033b2d.tar.bz2
Add a late IR expansion pass for the experimental reduction intrinsics.
This pass uses a new target hook to decide whether or not to expand a particular intrinsic to the shuffevector sequence. Differential Revision: https://reviews.llvm.org/D32245 llvm-svn: 302631
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r--llvm/lib/Transforms/Utils/LoopUtils.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index d41fe62..81f033e 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -1125,11 +1125,10 @@ static Value *addFastMathFlag(Value *V) {
}
// Helper to generate a log2 shuffle reduction.
-static Value *
-getShuffleReduction(IRBuilder<> &Builder, Value *Src, unsigned Op,
- RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind =
- RecurrenceDescriptor::MRK_Invalid,
- ArrayRef<Value *> RedOps = ArrayRef<Value *>()) {
+Value *
+llvm::getShuffleReduction(IRBuilder<> &Builder, Value *Src, unsigned Op,
+ RecurrenceDescriptor::MinMaxRecurrenceKind MinMaxKind,
+ ArrayRef<Value *> RedOps) {
unsigned VF = Src->getType()->getVectorNumElements();
// VF is a power of 2 so we can emit the reduction using log2(VF) shuffles
// and vector ops, reducing the set of values being computed by half each