GlobalISel: Use result of find rather than rechecking map

This commit is contained in:
Matt Arsenault 2020-07-29 09:42:03 -04:00
parent 66c572af55
commit 7d0b32c268
1 changed files with 3 additions and 2 deletions

View File

@ -222,8 +222,9 @@ ArrayRef<Register> IRTranslator::getOrCreateVRegs(const Value &Val) {
}
int IRTranslator::getOrCreateFrameIndex(const AllocaInst &AI) {
if (FrameIndices.find(&AI) != FrameIndices.end())
return FrameIndices[&AI];
auto MapEntry = FrameIndices.find(&AI);
if (MapEntry != FrameIndices.end())
return MapEntry->second;
uint64_t ElementSize = DL->getTypeAllocSize(AI.getAllocatedType());
uint64_t Size =