Skip to content

Commit

Permalink
[CodeGen] Avoid repeated hash lookups (NFC) (#126403)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata authored Feb 9, 2025
1 parent 6444ed5 commit c741cf1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions llvm/lib/CodeGen/StackColoring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1115,9 +1115,10 @@ void StackColoring::remapInstructions(DenseMap<int, int> &SlotRemap) {
if (WinEHFuncInfo *EHInfo = MF->getWinEHFuncInfo())
for (WinEHTryBlockMapEntry &TBME : EHInfo->TryBlockMap)
for (WinEHHandlerType &H : TBME.HandlerArray)
if (H.CatchObj.FrameIndex != std::numeric_limits<int>::max() &&
SlotRemap.count(H.CatchObj.FrameIndex))
H.CatchObj.FrameIndex = SlotRemap[H.CatchObj.FrameIndex];
if (H.CatchObj.FrameIndex != std::numeric_limits<int>::max())
if (auto It = SlotRemap.find(H.CatchObj.FrameIndex);
It != SlotRemap.end())
H.CatchObj.FrameIndex = It->second;

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

0 comments on commit c741cf1

Please sign in to comment.