[llvm] 29e1a76 - [llvm-exegesis] Avoid repeated hash lookups (NFC) (#132331)

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 21 01:06:28 PDT 2025


Author: Kazu Hirata
Date: 2025-03-21T01:06:25-07:00
New Revision: 29e1a7673c969e702f0b86527d811e7160cfe4ef

URL: https://github.com/llvm/llvm-project/commit/29e1a7673c969e702f0b86527d811e7160cfe4ef
DIFF: https://github.com/llvm/llvm-project/commit/29e1a7673c969e702f0b86527d811e7160cfe4ef.diff

LOG: [llvm-exegesis] Avoid repeated hash lookups (NFC) (#132331)

Added: 
    

Modified: 
    llvm/tools/llvm-exegesis/lib/Assembler.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-exegesis/lib/Assembler.cpp b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
index b6104d10af3ca..f638478e0c51d 100644
--- a/llvm/tools/llvm-exegesis/lib/Assembler.cpp
+++ b/llvm/tools/llvm-exegesis/lib/Assembler.cpp
@@ -65,11 +65,12 @@ static bool generateSnippetSetupCode(const ExegesisTarget &ET,
       assert(MM.Address % getpagesize() == 0 &&
              "Memory mappings need to be aligned to page boundaries.");
 #endif
+      const MemoryValue &MemVal = Key.MemoryValues.at(MM.MemoryValueName);
       BBF.addInstructions(ET.generateMmap(
-          MM.Address, Key.MemoryValues.at(MM.MemoryValueName).SizeBytes,
+          MM.Address, MemVal.SizeBytes,
           ET.getAuxiliaryMemoryStartAddress() +
-              sizeof(int) * (Key.MemoryValues.at(MM.MemoryValueName).Index +
-                             SubprocessMemory::AuxiliaryMemoryOffset)));
+              sizeof(int) *
+                  (MemVal.Index + SubprocessMemory::AuxiliaryMemoryOffset)));
     }
     BBF.addInstructions(ET.setStackRegisterToAuxMem());
   }


        


More information about the llvm-commits mailing list