[llvm] 4db54e9 - [AMDGPU] Avoid repeated hash lookups (NFC) (#128458)

via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 23 23:42:33 PST 2025


Author: Kazu Hirata
Date: 2025-02-23T23:42:30-08:00
New Revision: 4db54e9f1ac61e52c4318f17fa5d921501504a97

URL: https://github.com/llvm/llvm-project/commit/4db54e9f1ac61e52c4318f17fa5d921501504a97
DIFF: https://github.com/llvm/llvm-project/commit/4db54e9f1ac61e52c4318f17fa5d921501504a97.diff

LOG: [AMDGPU] Avoid repeated hash lookups (NFC) (#128458)

Added: 
    

Modified: 
    llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp b/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
index 5087f1a902456..6347636b60e58 100644
--- a/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
+++ b/llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
@@ -376,10 +376,11 @@ bool AMDGPURewriteOutArguments::runOnFunction(Function &F) {
 
   int RetIdx = RetTy->isVoidTy() ? 0 : 1;
   for (Argument &Arg : F.args()) {
-    if (!OutArgIndexes.count(Arg.getArgNo()))
+    auto It = OutArgIndexes.find(Arg.getArgNo());
+    if (It == OutArgIndexes.end())
       continue;
 
-    Type *EltTy = OutArgIndexes[Arg.getArgNo()];
+    Type *EltTy = It->second;
     const auto Align =
         DL->getValueOrABITypeAlignment(Arg.getParamAlign(), EltTy);
 


        


More information about the llvm-commits mailing list