[llvm] e2438ce - [BPF] Avoid repeated map lookups (NFC) (#131494)
    via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Sun Mar 16 09:29:16 PDT 2025
    
    
  
Author: Kazu Hirata
Date: 2025-03-16T09:29:12-07:00
New Revision: e2438ce9400243ce9367d74151e00d4772797ec4
URL: https://github.com/llvm/llvm-project/commit/e2438ce9400243ce9367d74151e00d4772797ec4
DIFF: https://github.com/llvm/llvm-project/commit/e2438ce9400243ce9367d74151e00d4772797ec4.diff
LOG: [BPF] Avoid repeated map lookups (NFC) (#131494)
Added: 
    
Modified: 
    llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
Removed: 
    
################################################################################
diff  --git a/llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp b/llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
index 3b336f87c9b34..d29ef24174b62 100644
--- a/llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
+++ b/llvm/lib/Target/BPF/BPFAbstractMemberAccess.cpp
@@ -836,8 +836,9 @@ Value *BPFAbstractMemberAccess::computeBaseAndAccessKey(CallInst *Call,
   // Put the access chain into a stack with the top as the head of the chain.
   while (Call) {
     CallStack.push(std::make_pair(Call, CInfo));
-    CInfo = AIChain[Call].second;
-    Call = AIChain[Call].first;
+    auto &Chain = AIChain[Call];
+    CInfo = Chain.second;
+    Call = Chain.first;
   }
 
   // The access offset from the base of the head of chain is also
        
    
    
More information about the llvm-commits
mailing list