[llvm] 0d0daef - [GlobalISel] Remove an unnecessary cast (NFC) (#146249)

via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 28 20:41:20 PDT 2025


Author: Kazu Hirata
Date: 2025-06-28T20:41:17-07:00
New Revision: 0d0daef6ee955be09e4355830cb4d638d4e184d5

URL: https://github.com/llvm/llvm-project/commit/0d0daef6ee955be09e4355830cb4d638d4e184d5
DIFF: https://github.com/llvm/llvm-project/commit/0d0daef6ee955be09e4355830cb4d638d4e184d5.diff

LOG: [GlobalISel] Remove an unnecessary cast (NFC) (#146249)

Idx is already of unsigned.

Added: 
    

Modified: 
    llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp

Removed: 
    


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