diff --git a/llvm/lib/IR/Type.cpp b/llvm/lib/IR/Type.cpp index e91bc8aa7e708b..b288ab00fde3df 100644 --- a/llvm/lib/IR/Type.cpp +++ b/llvm/lib/IR/Type.cpp @@ -132,7 +132,8 @@ TypeSize Type::getPrimitiveSizeInBits() const { } unsigned Type::getScalarSizeInBits() const { - return getScalarType()->getPrimitiveSizeInBits(); + // It is safe to assume that the scalar types have a fixed size. + return getScalarType()->getPrimitiveSizeInBits().getFixedSize(); } int Type::getFPMantissaWidth() const {