[llvm] [GlobalISel] Remove an unnecessary cast (NFC) (PR #146249)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 28 18:08:10 PDT 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/146249

Idx is already of unsigned.


>From 0d6dcf8d7053a34a0555f639b84b88585070b54b Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Sat, 28 Jun 2025 13:17:02 -0700
Subject: [PATCH] [GlobalISel] Remove an unnecessary cast (NFC)

Idx is already of unsigned.
---
 llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
index 1c4150127a908..b2f84351c9a95 100644
--- a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
@@ -458,7 +458,7 @@ bool LoadStoreOpt::processMergeCandidate(StoreMergeCandidate &C) {
     for (auto AliasInfo : reverse(C.PotentialAliases)) {
       MachineInstr *PotentialAliasOp = AliasInfo.first;
       unsigned PreCheckedIdx = AliasInfo.second;
-      if (static_cast<unsigned>(Idx) < PreCheckedIdx) {
+      if (Idx < PreCheckedIdx) {
         // Once our store index is lower than the index associated with the
         // potential alias, we know that we've already checked for this alias
         // and all of the earlier potential aliases too.



More information about the llvm-commits mailing list