diff --git a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp --- a/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp @@ -2071,7 +2071,7 @@ Value *V = LHS; unsigned MaskElems = Mask.size(); VectorType *SrcTy = cast(V->getType()); - unsigned VecBitWidth = SrcTy->getBitWidth(); + unsigned VecBitWidth = SrcTy->getPrimitiveSizeInBits().getFixedSize(); unsigned SrcElemBitWidth = DL.getTypeSizeInBits(SrcTy->getElementType()); assert(SrcElemBitWidth && "vector elements must have a bitwidth"); unsigned SrcNumElems = SrcTy->getNumElements(); diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp --- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp +++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp @@ -1395,7 +1395,8 @@ /// Flatten a vector type. Type *getShadowTyNoVec(Type *ty) { if (VectorType *vt = dyn_cast(ty)) - return IntegerType::get(*MS.C, vt->getBitWidth()); + return IntegerType::get(*MS.C, + vt->getPrimitiveSizeInBits().getFixedSize()); return ty; } diff --git a/llvm/lib/Transforms/Utils/FunctionComparator.cpp b/llvm/lib/Transforms/Utils/FunctionComparator.cpp --- a/llvm/lib/Transforms/Utils/FunctionComparator.cpp +++ b/llvm/lib/Transforms/Utils/FunctionComparator.cpp @@ -227,9 +227,9 @@ unsigned TyRWidth = 0; if (auto *VecTyL = dyn_cast(TyL)) - TyLWidth = VecTyL->getBitWidth(); + TyLWidth = VecTyL->getPrimitiveSizeInBits().getFixedSize(); if (auto *VecTyR = dyn_cast(TyR)) - TyRWidth = VecTyR->getBitWidth(); + TyRWidth = VecTyR->getPrimitiveSizeInBits().getFixedSize(); if (TyLWidth != TyRWidth) return cmpNumbers(TyLWidth, TyRWidth);