[llvm] abb594b - [SystemZ] Avoid repeated hash lookups (NFC) (#112072)

via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 12 08:01:29 PDT 2024


Author: Kazu Hirata
Date: 2024-10-12T08:01:26-07:00
New Revision: abb594b965a781d4babaf5bc6e112624a5357b66

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

LOG: [SystemZ] Avoid repeated hash lookups (NFC) (#112072)

Added: 
    

Modified: 
    llvm/lib/Target/SystemZ/SystemZISelLowering.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
index abf414fd1ffb71..c7626434efac67 100644
--- a/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
+++ b/llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
@@ -8340,11 +8340,11 @@ static void createPHIsForSelects(SmallVector<MachineInstr*, 8> &Selects,
     if (MI->getOperand(4).getImm() == (CCValid ^ CCMask))
       std::swap(TrueReg, FalseReg);
 
-    if (RegRewriteTable.contains(TrueReg))
-      TrueReg = RegRewriteTable[TrueReg].first;
+    if (auto It = RegRewriteTable.find(TrueReg); It != RegRewriteTable.end())
+      TrueReg = It->second.first;
 
-    if (RegRewriteTable.contains(FalseReg))
-      FalseReg = RegRewriteTable[FalseReg].second;
+    if (auto It = RegRewriteTable.find(FalseReg); It != RegRewriteTable.end())
+      FalseReg = It->second.second;
 
     DebugLoc DL = MI->getDebugLoc();
     BuildMI(*SinkMBB, SinkInsertionPoint, DL, TII->get(SystemZ::PHI), DestReg)


        


More information about the llvm-commits mailing list