[PATCH] D29900: [SLP] Fix for PR31879: vectorize repeated scalar ops that don't get put back into a vector
Alexey Bataev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 14 07:08:47 PST 2017
ABataev added inline comments.
================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1663
Instruction *E = cast<Instruction>(VL[i]);
- if (E->hasOneUse())
+ if (E->hasOneUse() ||
+ std::all_of(E->user_begin(), E->user_end(), [this](User *U) {
----------------
hfinkel wrote:
> Why is the hasOneUse check still needed if we're checking the ScalarToTreeEntry map? Or is this just a microoptimization?
>
Yes, it is a microoptimization. If we have only onlу user, this user will be vectorized/removed for sure
Repository:
rL LLVM
https://reviews.llvm.org/D29900
More information about the llvm-commits
mailing list