2016-01-16 06:44:18 +08:00
|
|
|
|
|
|
|
# All test suites added here should be excuded from check-all
|
|
|
|
set(EXCLUDE_FROM_ALL On)
|
|
|
|
|
2016-01-16 05:21:12 +08:00
|
|
|
if (CMAKE_CFG_INTDIR STREQUAL ".")
|
|
|
|
set(LLVM_BUILD_MODE ".")
|
|
|
|
else ()
|
|
|
|
set(LLVM_BUILD_MODE "%(build_mode)s")
|
|
|
|
endif ()
|
2015-12-16 09:02:44 +08:00
|
|
|
|
2016-01-16 05:21:12 +08:00
|
|
|
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
|
2015-12-16 09:02:44 +08:00
|
|
|
|
2016-01-16 05:21:12 +08:00
|
|
|
if(LLVM_BUILD_INSTRUMENTED)
|
2015-12-16 09:02:44 +08:00
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
|
2016-01-16 05:21:12 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/pgo-data/lit.site.cfg
|
2015-12-16 09:02:44 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
add_lit_testsuite(generate-profraw "Generating clang PGO data"
|
2016-01-16 05:21:12 +08:00
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/pgo-data/
|
2015-12-16 09:02:44 +08:00
|
|
|
DEPENDS clang clear-profraw
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(clear-profraw
|
2016-01-16 05:21:12 +08:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean ${CMAKE_CURRENT_BINARY_DIR} profraw
|
2015-12-16 09:02:44 +08:00
|
|
|
COMMENT "Clearing old profraw data")
|
|
|
|
|
|
|
|
if(NOT LLVM_PROFDATA)
|
|
|
|
find_program(LLVM_PROFDATA llvm-profdata)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT LLVM_PROFDATA)
|
|
|
|
message(FATAL_ERROR "Must set LLVM_PROFDATA to point to llvm-profdata to use for merging PGO data")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_custom_target(generate-profdata
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge ${LLVM_PROFDATA} ${CMAKE_CURRENT_BINARY_DIR}/clang.profdata ${CMAKE_CURRENT_BINARY_DIR}
|
|
|
|
COMMENT "Merging profdata"
|
|
|
|
DEPENDS generate-profraw)
|
|
|
|
endif()
|
2016-01-16 05:21:12 +08:00
|
|
|
|
|
|
|
find_program(DTRACE dtrace)
|
|
|
|
if(DTRACE)
|
|
|
|
configure_lit_site_cfg(
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/order-files.lit.site.cfg.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/order-files/lit.site.cfg
|
|
|
|
)
|
|
|
|
|
|
|
|
add_lit_testsuite(generate-dtrace-logs "Generating clang dtrace data"
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/order-files/
|
|
|
|
DEPENDS clang clear-dtrace-logs
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(clear-dtrace-logs
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean ${CMAKE_CURRENT_BINARY_DIR} dtrace
|
|
|
|
COMMENT "Clearing old dtrace data")
|
|
|
|
|
2016-02-17 10:13:35 +08:00
|
|
|
|
2016-01-16 05:21:12 +08:00
|
|
|
add_custom_target(generate-order-file
|
2016-02-17 10:13:35 +08:00
|
|
|
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py gen-order-file --binary $<TARGET_FILE:clang> --output ${CMAKE_CURRENT_BINARY_DIR}/clang.order ${CMAKE_CURRENT_BINARY_DIR}
|
2016-01-16 05:21:12 +08:00
|
|
|
COMMENT "Generating order file"
|
|
|
|
DEPENDS generate-dtrace-logs)
|
|
|
|
endif()
|