diff --git a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp index 18008c614bd5..e27650b3297d 100644 --- a/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp +++ b/mlir/lib/Dialect/LLVMIR/IR/LLVMTypes.cpp @@ -58,8 +58,9 @@ llvm::TypeSize LLVMType::getPrimitiveSizeInBits() { llvm::ElementCount elementCount = t.getElementCount(); assert(!elementSize.isScalable() && "vector type should have fixed-width elements"); - return llvm::TypeSize(elementSize.getFixedSize() * elementCount.Min, - elementCount.Scalable); + return llvm::TypeSize(elementSize.getFixedSize() * + elementCount.getKnownMinValue(), + elementCount.isScalable()); }) .Default([](LLVMType ty) { assert((ty.isa