[llvm] a588e20 - [SelectionDAG] Avoid repeated hash lookups (NFC) (#123697)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 21 00:24:52 PST 2025


Author: Kazu Hirata
Date: 2025-01-21T16:24:49+08:00
New Revision: a588e20280435a880c730602c3bf0a7f78e599f2

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

LOG: [SelectionDAG] Avoid repeated hash lookups (NFC) (#123697)

Added: 
    

Modified: 
    llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
index a838003c34dfb0..987ea826f782e7 100644
--- a/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/StatepointLowering.cpp
@@ -871,10 +871,11 @@ SDValue SelectionDAGBuilder::LowerAsSTATEPOINT(
   for (const auto *Relocate : SI.GCRelocates) {
     Value *Derived = Relocate->getDerivedPtr();
     SDValue SD = getValue(Derived);
-    if (!LowerAsVReg.count(SD))
+    auto It = LowerAsVReg.find(SD);
+    if (It == LowerAsVReg.end())
       continue;
 
-    SDValue Relocated = SDValue(StatepointMCNode, LowerAsVReg[SD]);
+    SDValue Relocated = SDValue(StatepointMCNode, It->second);
 
     // Handle local relocate. Note that 
diff erent relocates might
     // map to the same SDValue.


        


More information about the llvm-commits mailing list