[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
Mon Feb 13 11:58:33 PST 2017


hfinkel added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1629
+/// Checks that \p I is used in the single instruction.
+static bool hasOneUse(Instruction *I) {
+  if (I->hasOneUse())
----------------
Maybe this should be called hasOneUser?


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:1672
           Instruction *E = cast<Instruction>(VL[i]);
-          if (E->hasOneUse())
+          if (hasOneUse(E))
             // Take credit for instruction that will become dead.
----------------
Why are we checking this use(r) count at all? If canReuseExtract is true, then don't we just care that all users are part of the to-be-vectorized tree?



https://reviews.llvm.org/D29900





More information about the llvm-commits mailing list