[SVE]Fix implicit TypeSize casts in EmitCheckValue
authorCaroline Concatto <caroline.concatto@arm.com>
Tue, 13 Oct 2020 12:41:54 +0000 (13:41 +0100)
committerCaroline Concatto <caroline.concatto@arm.com>
Thu, 15 Oct 2020 12:25:46 +0000 (13:25 +0100)
Using TypeSize::getFixedSize() instead of relying upon the implicit
TypeSize->uint64_cast as the type is always fixed width.

Differential Revision: https://reviews.llvm.org/D89313

clang/lib/CodeGen/CGExpr.cpp

index 2f54097..ed2c8e6 100644 (file)
@@ -2996,7 +2996,7 @@ llvm::Value *CodeGenFunction::EmitCheckValue(llvm::Value *V) {
   // Floating-point types which fit into intptr_t are bitcast to integers
   // and then passed directly (after zero-extension, if necessary).
   if (V->getType()->isFloatingPointTy()) {
-    unsigned Bits = V->getType()->getPrimitiveSizeInBits();
+    unsigned Bits = V->getType()->getPrimitiveSizeInBits().getFixedSize();
     if (Bits <= TargetTy->getIntegerBitWidth())
       V = Builder.CreateBitCast(V, llvm::Type::getIntNTy(getLLVMContext(),
                                                          Bits));