| 1 |
add_library(automemcpy_codegen CodeGen.cpp) |
| 2 |
target_link_libraries(automemcpy_codegen PUBLIC LLVMSupport) |
| 3 |
target_include_directories(automemcpy_codegen PUBLIC ${LIBC_AUTOMEMCPY_INCLUDE_DIR}) |
| 4 |
llvm_update_compile_flags(automemcpy_codegen) |
| 5 |
|
| 6 |
add_executable(automemcpy_codegen_main CodeGenMain.cpp RandomFunctionGenerator.cpp) |
| 7 |
target_link_libraries(automemcpy_codegen_main PUBLIC automemcpy_codegen ${Z3_LIBRARIES}) |
| 8 |
llvm_update_compile_flags(automemcpy_codegen_main) |
| 9 |
|
| 10 |
set(Implementations "${CMAKE_CURRENT_BINARY_DIR}/Implementations.cpp") |
| 11 |
add_custom_command( |
| 12 |
OUTPUT ${Implementations} |
| 13 |
COMMAND "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/automemcpy_codegen_main" > "${Implementations}" |
| 14 |
COMMAND echo "automemcpy implementations generated in ${Implementations}" |
| 15 |
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" |
| 16 |
DEPENDS automemcpy_codegen_main |
| 17 |
) |
| 18 |
|
| 19 |
add_library(automemcpy_implementations "${Implementations}") |
| 20 |
target_link_libraries(automemcpy_implementations PUBLIC LLVMSupport libc-memory-benchmark) |
| 21 |
target_include_directories(automemcpy_implementations PRIVATE ${LIBC_SOURCE_DIR} ${LIBC_AUTOMEMCPY_INCLUDE_DIR}) |
| 22 |
target_compile_options(automemcpy_implementations PRIVATE ${LIBC_COMPILE_OPTIONS_NATIVE} "SHELL:-mllvm -combiner-global-alias-analysis" -fno-builtin) |
| 23 |
llvm_update_compile_flags(automemcpy_implementations) |
| 24 |
|
| 25 |
add_executable(automemcpy EXCLUDE_FROM_ALL ${LIBC_SOURCE_DIR}/benchmarks/LibcMemoryGoogleBenchmarkMain.cpp) |
| 26 |
target_link_libraries(automemcpy PRIVATE libc-memory-benchmark benchmark_main automemcpy_implementations) |
| 27 |
llvm_update_compile_flags(automemcpy) |
| 28 |
|
| 29 |
add_library(automemcpy_result_analyzer_lib EXCLUDE_FROM_ALL ResultAnalyzer.cpp) |
| 30 |
target_link_libraries(automemcpy_result_analyzer_lib PUBLIC LLVMSupport) |
| 31 |
target_include_directories(automemcpy_result_analyzer_lib PUBLIC ${LIBC_AUTOMEMCPY_INCLUDE_DIR}) |
| 32 |
llvm_update_compile_flags(automemcpy_result_analyzer_lib) |
| 33 |
|
| 34 |
add_executable(automemcpy_result_analyzer EXCLUDE_FROM_ALL ResultAnalyzerMain.cpp) |
| 35 |
target_link_libraries(automemcpy_result_analyzer PRIVATE automemcpy_result_analyzer_lib automemcpy_implementations) |
| 36 |
llvm_update_compile_flags(automemcpy_result_analyzer) |