[PATCH] D151891: Increase memory of BOLT runtime instrumentation bump allocator used for writing resulting profile

Jakub Beránek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 7 03:09:49 PDT 2023


Kobzol updated this revision to Diff 529226.
Kobzol added a comment.

I removed the configuration and instead increased the size of the bump allocator that had the default size.

(I wasn't sure if I should upload a diff containing only the memory increase or if the diff should also "undo" the first diff. Hopefully I didn't mess this up).


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D151891/new/

https://reviews.llvm.org/D151891

Files:
  bolt/CMakeLists.txt
  bolt/runtime/CMakeLists.txt
  bolt/runtime/instr.cpp


Index: bolt/runtime/instr.cpp
===================================================================
--- bolt/runtime/instr.cpp
+++ bolt/runtime/instr.cpp
@@ -206,7 +206,7 @@
 
 private:
   static constexpr uint64_t Magic = 0x1122334455667788ull;
-  uint64_t MaxSize = RUNTIME_MAX_MEMORY;
+  uint64_t MaxSize = 0xa00000;
   uint8_t *StackBase{nullptr};
   uint64_t StackSize{0};
   bool Shared{false};
@@ -1471,6 +1471,7 @@
   int FD = openProfile();
 
   BumpPtrAllocator Alloc;
+  Alloc.setMaxSize(0x6400000);
   const uint8_t *FuncDesc = Ctx.FuncDescriptions;
   for (int I = 0, E = __bolt_instr_num_funcs; I < E; ++I) {
     FuncDesc = writeFunctionProfile(FD, Ctx, FuncDesc, Alloc);
Index: bolt/runtime/CMakeLists.txt
===================================================================
--- bolt/runtime/CMakeLists.txt
+++ bolt/runtime/CMakeLists.txt
@@ -14,9 +14,6 @@
   instr.cpp
   ${CMAKE_CURRENT_BINARY_DIR}/config.h
   )
-option(BOLT_RT_MAX_MEM "Maximum memory for runtime allocations.")
-target_compile_definitions(bolt_rt_instr PRIVATE RUNTIME_MAX_MEMORY=${BOLT_RT_MAX_MEM})
-
 add_library(bolt_rt_hugify STATIC
   hugify.cpp
   ${CMAKE_CURRENT_BINARY_DIR}/config.h
Index: bolt/CMakeLists.txt
===================================================================
--- bolt/CMakeLists.txt
+++ bolt/CMakeLists.txt
@@ -44,8 +44,6 @@
   endif()
 endif()
 
-option(BOLT_RT_MAX_MEM "Maximum memory for runtime allocations." 0xa00000)
-
 if (BOLT_ENABLE_RUNTIME)
   message(STATUS "Building BOLT runtime libraries for X86")
   ExternalProject_Add(bolt_rt
@@ -57,8 +55,7 @@
                -DCMAKE_BUILD_TYPE=Release
                -DCMAKE_MAKE_PROGRAM=${CMAKE_MAKE_PROGRAM}
                -DCMAKE_INSTALL_PREFIX=${LLVM_BINARY_DIR}
-               -DBOLT_RT_MAX_MEM=${BOLT_RT_MAX_MEM}
-          BUILD_ALWAYS True
+    BUILD_ALWAYS True
     )
   install(CODE "execute_process\(COMMAND \${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=\${CMAKE_INSTALL_PREFIX} -P ${CMAKE_CURRENT_BINARY_DIR}/bolt_rt-bins/cmake_install.cmake \)"
     COMPONENT bolt)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D151891.529226.patch
Type: text/x-patch
Size: 2041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230607/8c43e8a3/attachment.bin>


More information about the llvm-commits mailing list