[llvm] 574713c - [ExecutionEngine] Initialize near block hint in SectionMemoryManager.

Lang Hames via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 20 14:43:07 PDT 2020


Author: Lang Hames
Date: 2020-07-20T14:40:54-07:00
New Revision: 574713c3076c11a5677f554ab132d1324be9cb00

URL: https://github.com/llvm/llvm-project/commit/574713c3076c11a5677f554ab132d1324be9cb00
DIFF: https://github.com/llvm/llvm-project/commit/574713c3076c11a5677f554ab132d1324be9cb00.diff

LOG: [ExecutionEngine] Initialize near block hint in SectionMemoryManager.

When allocating a new memory block in SectionMemoryManager, initialize
the Near hint for the other memory groups if they have not been set
already.

Patch by Dana Koch. Thanks Dana!

Added: 
    

Modified: 
    llvm/lib/ExecutionEngine/SectionMemoryManager.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
index 925049b2a1b4..febcabfaa571 100644
--- a/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
+++ b/llvm/lib/ExecutionEngine/SectionMemoryManager.cpp
@@ -112,6 +112,15 @@ uint8_t *SectionMemoryManager::allocateSection(
   // Save this address as the basis for our next request
   MemGroup.Near = MB;
 
+  // Copy the address to all the other groups, if they have not
+  // been initialized.
+  if (CodeMem.Near.base() == 0)
+    CodeMem.Near = MB;
+  if (RODataMem.Near.base() == 0)
+    RODataMem.Near = MB;
+  if (RWDataMem.Near.base() == 0)
+    RWDataMem.Near = MB;
+
   // Remember that we allocated this memory
   MemGroup.AllocatedMem.push_back(MB);
   Addr = (uintptr_t)MB.base();


        


More information about the llvm-commits mailing list