Skip to content

Commit 2d8cd32

Browse files
[InstCombine] Avoid repeated hash lookups (NFC) (#111618)
1 parent 1e81056 commit 2d8cd32

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,9 @@ static Value *rewriteGEPAsOffset(Value *Start, Value *Base, GEPNoWrapFlags NW,
602602
for (unsigned I = 0, E = PHI->getNumIncomingValues(); I < E; ++I) {
603603
Value *NewIncoming = PHI->getIncomingValue(I);
604604

605-
if (NewInsts.contains(NewIncoming))
606-
NewIncoming = NewInsts[NewIncoming];
605+
auto It = NewInsts.find(NewIncoming);
606+
if (It != NewInsts.end())
607+
NewIncoming = It->second;
607608

608609
NewPhi->addIncoming(NewIncoming, PHI->getIncomingBlock(I));
609610
}

0 commit comments

Comments
 (0)