Skip to content

Commit e7bf6a4

Browse files
[CodeGen] Avoid repeated map lookups (NFC) (llvm#127025)
1 parent 44b61e0 commit e7bf6a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/LiveStacks.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ LiveStacks::getOrCreateInterval(int Slot, const TargetRegisterClass *RC) {
6262
S2RCMap.insert(std::make_pair(Slot, RC));
6363
} else {
6464
// Use the largest common subclass register class.
65-
const TargetRegisterClass *OldRC = S2RCMap[Slot];
66-
S2RCMap[Slot] = TRI->getCommonSubClass(OldRC, RC);
65+
const TargetRegisterClass *&OldRC = S2RCMap[Slot];
66+
OldRC = TRI->getCommonSubClass(OldRC, RC);
6767
}
6868
return I->second;
6969
}

0 commit comments

Comments
 (0)