Skip to content

Commit 4db54e9

Browse files
[AMDGPU] Avoid repeated hash lookups (NFC) (#128458)
1 parent f89a986 commit 4db54e9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,10 +376,11 @@ bool AMDGPURewriteOutArguments::runOnFunction(Function &F) {
376376

377377
int RetIdx = RetTy->isVoidTy() ? 0 : 1;
378378
for (Argument &Arg : F.args()) {
379-
if (!OutArgIndexes.count(Arg.getArgNo()))
379+
auto It = OutArgIndexes.find(Arg.getArgNo());
380+
if (It == OutArgIndexes.end())
380381
continue;
381382

382-
Type *EltTy = OutArgIndexes[Arg.getArgNo()];
383+
Type *EltTy = It->second;
383384
const auto Align =
384385
DL->getValueOrABITypeAlignment(Arg.getParamAlign(), EltTy);
385386

0 commit comments

Comments
 (0)