[PATCH] D29900: [SLP] Fix for PR31879: vectorize repeated scalar ops that don't get put back into a vector

Hal Finkel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 14 07:05:38 PST 2017


hfinkel 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) {
----------------
Why is the hasOneUse check still needed if we're checking the ScalarToTreeEntry map? Or is this just a microoptimization?



Repository:
  rL LLVM

https://reviews.llvm.org/D29900





More information about the llvm-commits mailing list