[llvm] d017767 - [ADT] Avoid repeated hash lookups (NFC) (#131418)

via llvm-commits llvm-commits at lists.llvm.org
Sat Mar 15 21:01:22 PDT 2025


Author: Kazu Hirata
Date: 2025-03-15T21:01:19-07:00
New Revision: d0177670a0e59e9d9719386f85bb78de0929407c

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

LOG: [ADT] Avoid repeated hash lookups (NFC) (#131418)

Added: 
    

Modified: 
    llvm/include/llvm/ADT/SCCIterator.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/ADT/SCCIterator.h b/llvm/include/llvm/ADT/SCCIterator.h
index fef8cdb748442..64ee217eeed61 100644
--- a/llvm/include/llvm/ADT/SCCIterator.h
+++ b/llvm/include/llvm/ADT/SCCIterator.h
@@ -366,9 +366,9 @@ scc_member_iterator<GraphT, GT>::scc_member_iterator(
     Queue.pop();
     Nodes.push_back(Node);
     for (auto &Edge : Node->Edges) {
-      NodeInfoMap[Edge.Target].IncomingMSTEdges.erase(&Edge);
-      if (MSTEdges.count(&Edge) &&
-          NodeInfoMap[Edge.Target].IncomingMSTEdges.empty()) {
+      NodeInfo &Info = NodeInfoMap[Edge.Target];
+      Info.IncomingMSTEdges.erase(&Edge);
+      if (MSTEdges.count(&Edge) && Info.IncomingMSTEdges.empty()) {
         Queue.push(Edge.Target);
       }
     }


        


More information about the llvm-commits mailing list