[llvm] [SLP] Collect candidate VFs in vector in vectorizeStores (NFC). (PR #82793)

Florian Hahn via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 08:15:23 PST 2024


================
@@ -13918,10 +13918,14 @@ bool SLPVectorizerPass::vectorizeStores(ArrayRef<StoreInst *> Stores,
                           << "MinVF (" << MinVF << ")\n");
       }
 
-      // FIXME: Is division-by-2 the correct step? Should we assert that the
-      // register size is a power-of-2?
-      unsigned StartIdx = 0;
+      SmallVector<unsigned> CandidateVFs;
       for (unsigned Size = MaxVF; Size >= MinVF; Size /= 2) {
+        // FIXME: Is division-by-2 the correct step? Should we assert that the
+        // register size is a power-of-2?
+        CandidateVFs.push_back(Size);
+      }
----------------
fhahn wrote:

Adjusted, but needed to use ` unsigned Sz = 1 + Log2_32(MaxVF) - Log2_32(MinVF);` and introduce early exit https://github.com/llvm/llvm-project/pull/83283 so we don't need to handle the case where. MaxVF < MinVF.

https://github.com/llvm/llvm-project/pull/82793


More information about the llvm-commits mailing list