[PATCH] D18237: [SLPVectorizer] Try to vectorize in the range from MaxVecRegSize to MinVecRegSize

Chad Rosier via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 07:15:15 PDT 2016


mcrosier added a comment.

I should have suggested this earlier (sorry), but do you think it make sense to push the loops into tryToVectorizeList and canMatchHorizontalReduction?  I think it does; it avoids a lot of duplicated code at each call site.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4323
@@ +4322,3 @@
+      if (NumElts > 1) {
+        bool SuccessToVectorizeList = false;
+        for (unsigned VecRegSize = MaxVecRegSize; VecRegSize >= MinVecRegSize;
----------------
No that this logic is cleaned up you don't need the temporary bool.

  for (unsigned VecRegSize = MaxVecRegSize; VecRegSize >= MinVecRegSize; VecRegSize /= 2) {
    if (tryToVectorizeList(makeArrayRef(IncIt, NumElts), R, None, false, VecRegSize)) {
      // Success start over because instructions might have been changed.
      HaveVectorizedPhiNodes = true;
      Changed = true;
      break;
    }
  }


http://reviews.llvm.org/D18237





More information about the llvm-commits mailing list