[llvm] [NFC][ARM] Remove unneeded cast (PR #229504)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 6 10:52:50 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-arm

Author: Ben Wu (benwu25)

<details>
<summary>Changes</summary>

`MCConstantExpr::getValue()` returns `int64_t` already.

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


1 Files Affected:

- (modified) llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp (+1-2) 


``````````diff
diff --git a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
index 032ba8b0de0411..ab94d8eb21f441 100644
--- a/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
+++ b/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp
@@ -9301,8 +9301,7 @@ bool ARMAsmParser::processInstruction(MCInst &Inst,
     if (isa<MCConstantExpr>(SubExprVal) &&
         Inst.getOperand(0).getReg() != ARM::PC &&
         Inst.getOperand(0).getReg() != ARM::SP) {
-      int64_t Value =
-        (int64_t) (cast<MCConstantExpr>(SubExprVal))->getValue();
+      int64_t Value = (cast<MCConstantExpr>(SubExprVal))->getValue();
       bool UseMov  = true;
       bool MovHasS = true;
       if (Inst.getOpcode() == ARM::LDRConstPool) {

``````````

</details>


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


More information about the llvm-commits mailing list