[llvm] 7e7a362 - [Hexagon] Avoid repeated map lookups (NFC) (#127304)

via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 15 01:38:03 PST 2025


Author: Kazu Hirata
Date: 2025-02-15T01:38:00-08:00
New Revision: 7e7a3623b44da5019878b91d8334d4c16d7b86a9

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

LOG: [Hexagon] Avoid repeated map lookups (NFC) (#127304)

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/Hexagon/RDFCopy.cpp b/llvm/lib/Target/Hexagon/RDFCopy.cpp
index fdd7e4cf99e35..fafdad08909dd 100644
--- a/llvm/lib/Target/Hexagon/RDFCopy.cpp
+++ b/llvm/lib/Target/Hexagon/RDFCopy.cpp
@@ -133,8 +133,8 @@ bool CopyPropagation::run() {
     for (NodeId I : Copies) {
       dbgs() << "Instr: " << *DFG.addr<StmtNode*>(I).Addr->getCode();
       dbgs() << "   eq: {";
-      if (CopyMap.count(I)) {
-        for (auto J : CopyMap.at(I))
+      if (auto It = CopyMap.find(I); It != CopyMap.end()) {
+        for (auto J : It->second)
           dbgs() << ' ' << Print<RegisterRef>(J.first, DFG) << '='
                  << Print<RegisterRef>(J.second, DFG);
       }


        


More information about the llvm-commits mailing list