[CodeGen] Avoid repeated hash lookups (NFC) (#126403)

This commit is contained in:
Kazu Hirata 2025-02-09 08:55:43 -08:00 committed by GitHub
parent 6444ed5365
commit c741cf1617
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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");