Commit a5df1099 authored by Marius Wachtler's avatar Marius Wachtler

Object cache: hash IR as bitcode instead of as text string

cuts down time to JIT 'pip' from 115ms to 65ms
parent 6d392ba7
......@@ -93,7 +93,7 @@ endif()
add_subdirectory(${DEPS_DIR}/llvm-trunk ${CMAKE_BINARY_DIR}/llvm EXCLUDE_FROM_ALL)
set(CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}/llvm/share/llvm/cmake/")
include(LLVMConfig)
llvm_map_components_to_libnames(LLVM_LIBS core mcjit native bitreader ipo irreader debuginfodwarf instrumentation ${INTEL_JIT_EVENTS_LIB})
llvm_map_components_to_libnames(LLVM_LIBS core mcjit native bitreader bitwriter ipo irreader debuginfodwarf instrumentation ${INTEL_JIT_EVENTS_LIB})
# libunwind
if("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
......
......@@ -97,7 +97,7 @@ else
LLVM_BIN := $(LLVM_BUILD)/Release/bin
endif
LLVM_LINK_LIBS := core mcjit native bitreader ipo irreader debuginfodwarf instrumentation
LLVM_LINK_LIBS := core mcjit native bitreader bitwriter ipo irreader debuginfodwarf instrumentation
ifneq ($(ENABLE_INTEL_JIT_EVENTS),0)
LLVM_LINK_LIBS += inteljitevents
endif
......
......@@ -281,7 +281,7 @@ public:
// Generate a hash for the module
HashOStream hash_stream;
M->print(hash_stream, 0);
llvm::WriteBitcodeToFile(M, hash_stream);
hash_before_codegen = hash_stream.getHash();
llvm::SmallString<128> cache_file = cache_dir;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment