[llvm] [SLP][NFC] Fix assertion in vectorizeGEPIndices() (PR #76660)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 31 06:16:59 PST 2023


https://github.com/Enna1 created https://github.com/llvm/llvm-project/pull/76660

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

>From 93fa2ba4f19c7d5d784adfff4de36f9912ccb012 Mon Sep 17 00:00:00 2001
From: "xumingjie.enna1" <xumingjie.enna1 at bytedance.com>
Date: Sun, 31 Dec 2023 22:11:37 +0800
Subject: [PATCH] [SLP][NFC] Fix assertion in vectorizeGEPIndices()

The index constraints for the collected getelementptr instructions
should be single **and** non-constant.
---
 llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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