[PATCH] D30086: Add generic IR vector reductions
Elena Demikhovsky via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 23 23:38:33 PDT 2017
delena added inline comments.
================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1179
+ return Builder.CreateAddReduce(Src);
+ } else {
+ auto Rdx = Builder.CreateFAddReduce(ScalarUdf, Src);
----------------
the "else" is redundant.
================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1191
+
+Value *llvm::createTargetReduction(IRBuilder<> &Builder,
+ const TargetTransformInfo *TTI,
----------------
You implemented 2 functions with the same name. It's not clear what the difference between them. Please add some comments before each of them.
================
Comment at: lib/Transforms/Utils/LoopUtils.cpp:1281
+ return BuildFunc();
+ } else if (TTI->useReductionIntrinsic(Op, Src->getType()))
+ return BuildFunc();
----------------
I'd rather combine useMinMaxReductionIntrinsic and useReductionIntrinsic in one and provide 3 parameters: Type, Op and Flags
Repository:
rL LLVM
https://reviews.llvm.org/D30086
More information about the llvm-commits
mailing list