diff options
Diffstat (limited to 'llvm/lib/Transforms/Utils/LoopUtils.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/LoopUtils.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp index d2482fe..7f1bbeb 100644 --- a/llvm/lib/Transforms/Utils/LoopUtils.cpp +++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp @@ -1070,6 +1070,17 @@ Value *llvm::createTargetReduction(IRBuilderBase &B, return createSimpleTargetReduction(B, TTI, Src, Desc.getRecurrenceKind()); } +Value *llvm::createOrderedReduction(IRBuilderBase &B, + RecurrenceDescriptor &Desc, Value *Src, + Value *Start) { + auto Kind = Desc.getRecurrenceKind(); + assert(Kind == RecurKind::FAdd && "Unexpected reduction kind"); + assert(Src->getType()->isVectorTy() && "Expected a vector type"); + assert(!Start->getType()->isVectorTy() && "Expected a scalar type"); + + return B.CreateFAddReduce(Start, Src); +} + void llvm::propagateIRFlags(Value *I, ArrayRef<Value *> VL, Value *OpValue) { auto *VecOp = dyn_cast<Instruction>(I); if (!VecOp) |