[llvm] 6fe60bd - [SLP] Exit early if MaxVF < MinVF (NFCI). (#83283)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 11:43:09 PST 2024


Author: Florian Hahn
Date: 2024-03-01T19:43:06Z
New Revision: 6fe60bd89fc72398795de6ee2a6120b8af44a977

URL: https://github.com/llvm/llvm-project/commit/6fe60bd89fc72398795de6ee2a6120b8af44a977
DIFF: https://github.com/llvm/llvm-project/commit/6fe60bd89fc72398795de6ee2a6120b8af44a977.diff

LOG: [SLP] Exit early if MaxVF < MinVF (NFCI). (#83283)

Exit early if MaxVF < MinVF. In that case, the loop body below will
never get entered. Note that this adjusts the condition from MaxVF <=
MinVF. If MaxVF == MinVF, vectorization may still be feasible (and the
loop below gets entered).

PR: https://github.com/llvm/llvm-project/pull/83283

Added: 
    

Modified: 
    llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index 47681342239e1d..5e487a6b8a5daf 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -14019,10 +14019,11 @@ bool SLPVectorizerPass::vectorizeStores(ArrayRef<StoreInst *> Stores,
       unsigned MinVF = TTI->getStoreMinimumVF(
           R.getMinVF(DL->getTypeSizeInBits(ValueTy)), StoreTy, ValueTy);
 
-      if (MaxVF <= MinVF) {
+      if (MaxVF < MinVF) {
         LLVM_DEBUG(dbgs() << "SLP: Vectorization infeasible as MaxVF (" << MaxVF
-                          << ") <= "
+                          << ") < "
                           << "MinVF (" << MinVF << ")\n");
+        continue;
       }
 
       // FIXME: Is division-by-2 the correct step? Should we assert that the


        


More information about the llvm-commits mailing list