diff --git a/bolt/CMakeLists.txt b/bolt/CMakeLists.txt --- a/bolt/CMakeLists.txt +++ b/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) diff --git a/bolt/runtime/CMakeLists.txt b/bolt/runtime/CMakeLists.txt --- a/bolt/runtime/CMakeLists.txt +++ b/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 diff --git a/bolt/runtime/instr.cpp b/bolt/runtime/instr.cpp --- a/bolt/runtime/instr.cpp +++ b/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);