Skip to content

Commit 0609704

Browse files
committed
[SVE] Remove getNumElements() calls in visitGetElementPtrInst
Replace calls to getNumElements() with getElementCount() in order to avoid warnings for scalable vectors. The warnings were discovered by this existing test: test/CodeGen/AArch64/sve-gep.ll Differential revision: https://reviews.llvm.org/D80782
1 parent 41928c9 commit 0609704

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/IR/Verifier.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3429,16 +3429,16 @@ void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
34293429

34303430
if (auto *GEPVTy = dyn_cast<VectorType>(GEP.getType())) {
34313431
// Additional checks for vector GEPs.
3432-
unsigned GEPWidth = GEPVTy->getNumElements();
3432+
ElementCount GEPWidth = GEPVTy->getElementCount();
34333433
if (GEP.getPointerOperandType()->isVectorTy())
34343434
Assert(
34353435
GEPWidth ==
3436-
cast<VectorType>(GEP.getPointerOperandType())->getNumElements(),
3436+
cast<VectorType>(GEP.getPointerOperandType())->getElementCount(),
34373437
"Vector GEP result width doesn't match operand's", &GEP);
34383438
for (Value *Idx : Idxs) {
34393439
Type *IndexTy = Idx->getType();
34403440
if (auto *IndexVTy = dyn_cast<VectorType>(IndexTy)) {
3441-
unsigned IndexWidth = IndexVTy->getNumElements();
3441+
ElementCount IndexWidth = IndexVTy->getElementCount();
34423442
Assert(IndexWidth == GEPWidth, "Invalid GEP index vector width", &GEP);
34433443
}
34443444
Assert(IndexTy->isIntOrIntVectorTy(),

0 commit comments

Comments
 (0)