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

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 8 23:16:22 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-mips

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

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
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;

``````````

</details>


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


More information about the llvm-commits mailing list