From: Matt Arsenault Date: Wed, 29 Jul 2020 13:42:03 +0000 (-0400) Subject: GlobalISel: Use result of find rather than rechecking map X-Git-Tag: llvmorg-13-init~16334 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7d0b32c268ab4cfbc0630b2836890f2aef128d8b;p=platform%2Fupstream%2Fllvm.git GlobalISel: Use result of find rather than rechecking map --- diff --git a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp index f9b0843..264af2b 100644 --- a/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp +++ b/llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp @@ -222,8 +222,9 @@ ArrayRef 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 =