[PATCH] D45366: Support generic expansion of ordered vector reduction (PR36732)

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 6 09:30:11 PDT 2018


RKSimon added a comment.

In https://reviews.llvm.org/D45366#1059769, @rengolin wrote:

> For now, that the shuffle reduction is in loop utils, this patch is fine. But this really ought to be in target transform info.


I agree, I'll do that as an NFC once we've finalised the behaviour of reductions a bit more.



================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1531
+Value *
+llvm::getOrderedReduction(IRBuilder<> &Builder, Value *Acc, Value *Src,
+                          unsigned Op,
----------------
rengolin wrote:
> SVE will be able to do this with a single instruction, we should be able to override this based on target info.
This should be covered by TTI::useReductionIntrinsic


================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1537
+
+  auto CreateReductionOp = [&](Value *X, Value *Y) {
+    Value *Result;
----------------
ABataev wrote:
> 1. `auto`->`auto &&`
> 2. Use explicit capturing
Even better, I'll remove the lambda entirely and inline it.


Repository:
  rL LLVM

https://reviews.llvm.org/D45366





More information about the llvm-commits mailing list