[clang] 145e44b - [SVE]Fix implicit TypeSize casts in EmitCheckValue

Caroline Concatto via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 15 05:30:59 PDT 2020


Author: Caroline Concatto
Date: 2020-10-15T13:25:46+01:00
New Revision: 145e44bb18853bc9beeac0e64fffd9e6895e71f9

URL: https://github.com/llvm/llvm-project/commit/145e44bb18853bc9beeac0e64fffd9e6895e71f9
DIFF: https://github.com/llvm/llvm-project/commit/145e44bb18853bc9beeac0e64fffd9e6895e71f9.diff

LOG: [SVE]Fix implicit TypeSize casts in EmitCheckValue

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

Added: 
    

Modified: 
    clang/lib/CodeGen/CGExpr.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/CodeGen/CGExpr.cpp b/clang/lib/CodeGen/CGExpr.cpp
index 2f54097d9209..ed2c8e6a71f1 100644
--- a/clang/lib/CodeGen/CGExpr.cpp
+++ b/clang/lib/CodeGen/CGExpr.cpp
@@ -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));


        


More information about the cfe-commits mailing list