From 0609704760d0a94cccdbd243d0d750d74ee6c459 Mon Sep 17 00:00:00 2001 From: David Sherwood Date: Thu, 28 May 2020 16:33:44 +0100 Subject: [PATCH] [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 --- llvm/lib/IR/Verifier.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index cb96c7ae515a..677dc0210256 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -3429,16 +3429,16 @@ void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) { if (auto *GEPVTy = dyn_cast(GEP.getType())) { // Additional checks for vector GEPs. - unsigned GEPWidth = GEPVTy->getNumElements(); + ElementCount GEPWidth = GEPVTy->getElementCount(); if (GEP.getPointerOperandType()->isVectorTy()) Assert( GEPWidth == - cast(GEP.getPointerOperandType())->getNumElements(), + cast(GEP.getPointerOperandType())->getElementCount(), "Vector GEP result width doesn't match operand's", &GEP); for (Value *Idx : Idxs) { Type *IndexTy = Idx->getType(); if (auto *IndexVTy = dyn_cast(IndexTy)) { - unsigned IndexWidth = IndexVTy->getNumElements(); + ElementCount IndexWidth = IndexVTy->getElementCount(); Assert(IndexWidth == GEPWidth, "Invalid GEP index vector width", &GEP); } Assert(IndexTy->isIntOrIntVectorTy(),