Skip to content

Commit 0cb80c4

Browse files
[AMDGPU] Avoid repeated hash lookups (NFC) (llvm#113409)
1 parent 848bc1c commit 0cb80c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPULateCodeGenPrepare.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,8 +329,8 @@ bool LiveRegOptimizer::optimizeLiveType(
329329
Type *NewType = calculateConvertType(Phi->getType());
330330
NewPhi->addIncoming(ConstantInt::get(NewType, 0, false),
331331
Phi->getIncomingBlock(I));
332-
} else if (ValMap.contains(IncVal) && ValMap[IncVal])
333-
NewPhi->addIncoming(ValMap[IncVal], Phi->getIncomingBlock(I));
332+
} else if (Value *Val = ValMap.lookup(IncVal))
333+
NewPhi->addIncoming(Val, Phi->getIncomingBlock(I));
334334
else
335335
MissingIncVal = true;
336336
}

0 commit comments

Comments
 (0)