[llvm] 9943d33 - [SLP][NFC] Fix assertion in vectorizeGEPIndices() (#76660)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 2 05:32:22 PST 2024


Author: Enna1
Date: 2024-01-02T21:32:18+08:00
New Revision: 9943d33997e6bb85ad054c18ce44d037040d8565

URL: https://github.com/llvm/llvm-project/commit/9943d33997e6bb85ad054c18ce44d037040d8565
DIFF: https://github.com/llvm/llvm-project/commit/9943d33997e6bb85ad054c18ce44d037040d8565.diff

LOG: [SLP][NFC] Fix assertion in vectorizeGEPIndices() (#76660)

The index constraints for the collected getelementptr instructions
should be single **and** non-constant.

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 6359dc65d22634..ced081d4291645 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -16224,7 +16224,7 @@ bool SLPVectorizerPass::vectorizeGEPIndices(BasicBlock *BB, BoUpSLP &R) {
       for (auto *V : Candidates) {
         auto *GEP = cast<GetElementPtrInst>(V);
         auto *GEPIdx = GEP->idx_begin()->get();
-        assert(GEP->getNumIndices() == 1 || !isa<Constant>(GEPIdx));
+        assert(GEP->getNumIndices() == 1 && !isa<Constant>(GEPIdx));
         Bundle[BundleIndex++] = GEPIdx;
       }
 


        


More information about the llvm-commits mailing list