[llvm] [Support] Remove an unnecessary cast (NFC) (PR #154048)

via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 17 19:54:49 PDT 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-support

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

qp is already of uint64_t.


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


1 Files Affected:

- (modified) llvm/lib/Support/APInt.cpp (+1-1) 


``````````diff
diff --git a/llvm/lib/Support/APInt.cpp b/llvm/lib/Support/APInt.cpp
index 1547f48bc7ac0..0c0e1d042e75d 100644
--- a/llvm/lib/Support/APInt.cpp
+++ b/llvm/lib/Support/APInt.cpp
@@ -1377,7 +1377,7 @@ static void KnuthDiv(uint32_t *u, uint32_t *v, uint32_t *q, uint32_t* r,
     // the true value, and a "borrow" to the left should be remembered.
     int64_t borrow = 0;
     for (unsigned i = 0; i < n; ++i) {
-      uint64_t p = uint64_t(qp) * uint64_t(v[i]);
+      uint64_t p = qp * uint64_t(v[i]);
       int64_t subres = int64_t(u[j+i]) - borrow - Lo_32(p);
       u[j+i] = Lo_32(subres);
       borrow = Hi_32(p) - Hi_32(subres);

``````````

</details>


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


More information about the llvm-commits mailing list