[PATCH] D114171: [SLP]Improve reductions analysis and emission, part 1.
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jan 3 08:48:36 PST 2022
ABataev added inline comments.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8951
+ for (Value *V : Args)
+ ExtraArgs[TreeN] = V;
+ // Add reduction values. The values are sorted for better vectorization
----------------
RKSimon wrote:
> This looks weird - as if we're reassigning different values to ExtraArgs[TreeN] - since we know Args.size() < 2 - maybe something like this:
> ```
> if (!Args.empty())
> ExtraArgs[TreeN] = Args[0];
> ```
Sure, will rewrite it.
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:9101
+ for (unsigned Cnt = 0, Sz = ReducedVals[I + 1].size(); Cnt < Sz;
+ ++Cnt) {
+ Value *RdxVal = TrackedVals.find(ReducedVals[I + 1][Cnt])->second;
----------------
RKSimon wrote:
> for-range loop?
Ok
================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:9263
+ for (unsigned Cnt = 0, NumReducedVals = Candidates.size();
+ Cnt < NumReducedVals; ++Cnt) {
+ Value *RdxVal = Candidates[Cnt];
----------------
RKSimon wrote:
> Can we use a for-range loop here?
Ok, will check the loops.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D114171/new/
https://reviews.llvm.org/D114171
More information about the llvm-commits
mailing list