[llvm] 2c56383 - [Hexagon] Avoid repeated hash lookups (NFC) (#131719)

via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 18 07:54:57 PDT 2025


Author: Kazu Hirata
Date: 2025-03-18T07:54:54-07:00
New Revision: 2c56383de5ef665b7380225e777e716ee7a9b1be

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

LOG: [Hexagon] Avoid repeated hash lookups (NFC) (#131719)

Added: 
    

Modified: 
    llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
index 4bb1b1eb22eba..53943de3bc597 100644
--- a/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
+++ b/llvm/lib/Target/Hexagon/HexagonISelDAGToDAG.cpp
@@ -2437,10 +2437,7 @@ void HexagonDAGToDAGISel::rebalanceAddressTrees() {
         continue;
 
       // This root node has already been processed
-      if (RootWeights.count(N))
-        continue;
-
-      RootWeights[N] = -1;
+      RootWeights.try_emplace(N, -1);
     }
 
     // Balance node itself


        


More information about the llvm-commits mailing list