Skip to content

[Mips] Remove an unnecessary cast (NFC) #152837

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

kazutakahirata
Copy link
Contributor

getZExtValue() already returns uint64_t.

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

llvmbot commented Aug 9, 2025

@llvm/pr-subscribers-backend-mips

Author: Kazu Hirata (kazutakahirata)

Changes

getZExtValue() already returns uint64_t.


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

1 Files Affected:

  • (modified) llvm/lib/Target/Mips/MipsISelLowering.cpp (+1-1)
diff --git a/llvm/lib/Target/Mips/MipsISelLowering.cpp b/llvm/lib/Target/Mips/MipsISelLowering.cpp
index 881ba8e2f9eff..7b875a8436772 100644
--- a/llvm/lib/Target/Mips/MipsISelLowering.cpp
+++ b/llvm/lib/Target/Mips/MipsISelLowering.cpp
@@ -4408,7 +4408,7 @@ void MipsTargetLowering::LowerAsmOperandForConstraint(SDValue Op,
   case 'K': // unsigned 16 bit immediate
     if (ConstantSDNode *C = dyn_cast<ConstantSDNode>(Op)) {
       EVT Type = Op.getValueType();
-      uint64_t Val = (uint64_t)C->getZExtValue();
+      uint64_t Val = C->getZExtValue();
       if (isUInt<16>(Val)) {
         Result = DAG.getTargetConstant(Val, DL, Type);
         break;

@kazutakahirata kazutakahirata merged commit 5ebb22d into llvm:main Aug 9, 2025
11 checks passed
@kazutakahirata kazutakahirata deleted the cleanup_20250808_cast_llvm_Mips branch August 9, 2025 13:58
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