Skip to content

Conversation

kazutakahirata
Copy link
Contributor

getZExtValue() already return uint64_t.

getZExtValue() already return uint64_t.
@llvmbot
Copy link
Member

llvmbot commented Sep 4, 2025

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

Changes

getZExtValue() already return uint64_t.


Full diff: https://github.com/llvm/llvm-project/pull/156813.diff

1 Files Affected:

  • (modified) llvm/lib/Transforms/Utils/Local.cpp (+2-2)
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());
   }
 

@kazutakahirata kazutakahirata merged commit 3e28d3c into llvm:main Sep 4, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250903_cast_Utils branch September 4, 2025 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants