[llvm] [AArch64] Remove an unnecessary cast (NFC) (PR #155134)

via llvm-commits llvm-commits at lists.llvm.org
Sat Aug 23 20:27:09 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-aarch64

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

Val is already of int64_t.


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


1 Files Affected:

- (modified) llvm/lib/Target/AArch64/AArch64ISelLowering.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
index fbd8f7a979d66..d70a46b0e8939 100644
--- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
+++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
@@ -18309,7 +18309,7 @@ bool AArch64TargetLowering::shouldConvertConstantLoadToIntImm(const APInt &Imm,
   if (Val == 0 || AArch64_AM::isLogicalImmediate(Val, BitSize))
     return true;
 
-  if ((int64_t)Val < 0)
+  if (Val < 0)
     Val = ~Val;
   if (BitSize == 32)
     Val &= (1LL << 32) - 1;

``````````

</details>


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


More information about the llvm-commits mailing list