[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
This commit is contained in:
parent
41928c97b6
commit
0609704760
|
@ -3429,16 +3429,16 @@ void Verifier::visitGetElementPtrInst(GetElementPtrInst &GEP) {
|
|||
|
||||
if (auto *GEPVTy = dyn_cast<VectorType>(GEP.getType())) {
|
||||
// Additional checks for vector GEPs.
|
||||
unsigned GEPWidth = GEPVTy->getNumElements();
|
||||
ElementCount GEPWidth = GEPVTy->getElementCount();
|
||||
if (GEP.getPointerOperandType()->isVectorTy())
|
||||
Assert(
|
||||
GEPWidth ==
|
||||
cast<VectorType>(GEP.getPointerOperandType())->getNumElements(),
|
||||
cast<VectorType>(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<VectorType>(IndexTy)) {
|
||||
unsigned IndexWidth = IndexVTy->getNumElements();
|
||||
ElementCount IndexWidth = IndexVTy->getElementCount();
|
||||
Assert(IndexWidth == GEPWidth, "Invalid GEP index vector width", &GEP);
|
||||
}
|
||||
Assert(IndexTy->isIntOrIntVectorTy(),
|
||||
|
|
Loading…
Reference in New Issue