[llvm] [ExecutionEngine] Avoid repeated hash lookups (NFC) (PR #129191)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 27 21:41:58 PST 2025


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/129191

None

>From 1e7d97b159ea19b4eeca661edac570d020845377 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Thu, 27 Feb 2025 01:52:43 -0800
Subject: [PATCH] [ExecutionEngine] Avoid repeated hash lookups (NFC)

---
 llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
index 944fca000d61f..1989d8ca101e1 100644
--- a/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
+++ b/llvm/lib/ExecutionEngine/Orc/MemoryMapper.cpp
@@ -98,9 +98,9 @@ void InProcessMemoryMapper::initialize(MemoryMapper::AllocInfo &AI,
     std::lock_guard<std::mutex> Lock(Mutex);
 
     // This is the maximum range whose permission have been possibly modified
-    Allocations[MinAddr].Size = MaxAddr - MinAddr;
-    Allocations[MinAddr].DeinitializationActions =
-        std::move(*DeinitializeActions);
+    auto &Alloc = Allocations[MinAddr];
+    Alloc.Size = MaxAddr - MinAddr;
+    Alloc.DeinitializationActions = std::move(*DeinitializeActions);
     Reservations[AI.MappingBase.toPtr<void *>()].Allocations.push_back(MinAddr);
   }
 



More information about the llvm-commits mailing list