Skip to content

Commit aa066e3

Browse files
[AMDGPU] Avoid repeated hash lookups (NFC) (#126430)
1 parent b48b422 commit aa066e3

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPUPromoteAlloca.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,10 +839,9 @@ bool AMDGPUPromoteAllocaImpl::tryPromoteAllocaToVector(AllocaInst &Alloca) {
839839
return RejectUser(Inst, "mem transfer inst length is non-constant or "
840840
"not a multiple of the vector element size");
841841

842-
if (!TransferInfo.count(TransferInst)) {
842+
if (TransferInfo.try_emplace(TransferInst).second) {
843843
DeferredInsts.push_back(Inst);
844844
WorkList.push_back(Inst);
845-
TransferInfo[TransferInst] = MemTransferInfo();
846845
}
847846

848847
auto getPointerIndexOfAlloca = [&](Value *Ptr) -> ConstantInt * {

0 commit comments

Comments
 (0)