[llvm] 93507f6 - [PowerPC] Avoid repeated hash lookups (NFC) (#132145)

via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 20 09:11:35 PDT 2025


Author: Kazu Hirata
Date: 2025-03-20T09:11:32-07:00
New Revision: 93507f6c6779d9585e5b2d0eb775354929626757

URL: https://github.com/llvm/llvm-project/commit/93507f6c6779d9585e5b2d0eb775354929626757
DIFF: https://github.com/llvm/llvm-project/commit/93507f6c6779d9585e5b2d0eb775354929626757.diff

LOG: [PowerPC] Avoid repeated hash lookups (NFC) (#132145)

Added: 
    

Modified: 
    llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
index 800b96c45aecc..26cca52c2c480 100644
--- a/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
+++ b/llvm/lib/Target/PowerPC/PPCLoopInstrFormPrep.cpp
@@ -936,9 +936,9 @@ bool PPCLoopInstrFormPrep::prepareBaseForDispFormChain(Bucket &BucketChain,
   // 1 X form.
   unsigned MaxCountRemainder = 0;
   for (unsigned j = 0; j < (unsigned)Form; j++)
-    if ((RemainderOffsetInfo.contains(j)) &&
-        RemainderOffsetInfo[j].second >
-            RemainderOffsetInfo[MaxCountRemainder].second)
+    if (auto It = RemainderOffsetInfo.find(j);
+        It != RemainderOffsetInfo.end() &&
+        It->second.second > RemainderOffsetInfo[MaxCountRemainder].second)
       MaxCountRemainder = j;
 
   // Abort when there are too few insts with common base.


        


More information about the llvm-commits mailing list