[llvm] 3e28d3c - [Utils] Remove an unnecessary cast (NFC) (#156813)

via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 4 07:46:24 PDT 2025


Author: Kazu Hirata
Date: 2025-09-04T07:46:19-07:00
New Revision: 3e28d3c30edcab2ab4f94eb7802f38928e5ba16d

URL: https://github.com/llvm/llvm-project/commit/3e28d3c30edcab2ab4f94eb7802f38928e5ba16d
DIFF: https://github.com/llvm/llvm-project/commit/3e28d3c30edcab2ab4f94eb7802f38928e5ba16d.diff

LOG: [Utils] Remove an unnecessary cast (NFC) (#156813)

getZExtValue() already return uint64_t.

Added: 
    

Modified: 
    llvm/lib/Transforms/Utils/Local.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Utils/Local.cpp b/llvm/lib/Transforms/Utils/Local.cpp
index b94ed7db91580..2cfd70a1746c8 100644
--- a/llvm/lib/Transforms/Utils/Local.cpp
+++ b/llvm/lib/Transforms/Utils/Local.cpp
@@ -3397,8 +3397,8 @@ DIExpression *llvm::getExpressionForConstant(DIBuilder &DIB, const Constant &C,
   if (FP && Ty.isFloatingPointTy() && Ty.getScalarSizeInBits() <= 64) {
     const APFloat &APF = FP->getValueAPF();
     APInt const &API = APF.bitcastToAPInt();
-    if (auto Temp = API.getZExtValue())
-      return DIB.createConstantValueExpression(static_cast<uint64_t>(Temp));
+    if (uint64_t Temp = API.getZExtValue())
+      return DIB.createConstantValueExpression(Temp);
     return DIB.createConstantValueExpression(*API.getRawData());
   }
 


        


More information about the llvm-commits mailing list