Skip to content

Commit c741cf1

Browse files
[CodeGen] Avoid repeated hash lookups (NFC) (#126403)
1 parent 6444ed5 commit c741cf1

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

llvm/lib/CodeGen/StackColoring.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,9 +1115,10 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
11151115
if (WinEHFuncInfo *EHInfo = MF->getWinEHFuncInfo())
11161116
for (WinEHTryBlockMapEntry &TBME : EHInfo->TryBlockMap)
11171117
for (WinEHHandlerType &H : TBME.HandlerArray)
1118-
if (H.CatchObj.FrameIndex != std::numeric_limits<int>::max() &&
1119-
SlotRemap.count(H.CatchObj.FrameIndex))
1120-
H.CatchObj.FrameIndex = SlotRemap[H.CatchObj.FrameIndex];
1118+
if (H.CatchObj.FrameIndex != std::numeric_limits<int>::max())
1119+
if (auto It = SlotRemap.find(H.CatchObj.FrameIndex);
1120+
It != SlotRemap.end())
1121+
H.CatchObj.FrameIndex = It->second;
11211122

11221123
LLVM_DEBUG(dbgs() << "Fixed " << FixedMemOp << " machine memory operands.\n");
11231124
LLVM_DEBUG(dbgs() << "Fixed " << FixedDbg << " debug locations.\n");

0 commit comments

Comments
 (0)