• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2# All test suites added here should be excuded from check-all
3set(EXCLUDE_FROM_ALL On)
4
5if (CMAKE_CFG_INTDIR STREQUAL ".")
6  set(LLVM_BUILD_MODE ".")
7else ()
8  set(LLVM_BUILD_MODE "%(build_mode)s")
9endif ()
10
11string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
12
13if(LLVM_BUILD_INSTRUMENTED)
14  configure_lit_site_cfg(
15    ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
16    ${CMAKE_CURRENT_BINARY_DIR}/pgo-data/lit.site.cfg
17    )
18
19  add_lit_testsuite(generate-profraw "Generating clang PGO data"
20    ${CMAKE_CURRENT_BINARY_DIR}/pgo-data/
21    DEPENDS clang clear-profraw
22    )
23
24  add_custom_target(clear-profraw
25    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean ${CMAKE_CURRENT_BINARY_DIR} profraw
26    COMMENT "Clearing old profraw data")
27
28  if(NOT LLVM_PROFDATA)
29    find_program(LLVM_PROFDATA llvm-profdata)
30  endif()
31
32  if(NOT LLVM_PROFDATA)
33    message(FATAL_ERROR "Must set LLVM_PROFDATA to point to llvm-profdata to use for merging PGO data")
34  endif()
35
36  add_custom_target(generate-profdata
37    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py merge ${LLVM_PROFDATA} ${CMAKE_CURRENT_BINARY_DIR}/clang.profdata ${CMAKE_CURRENT_BINARY_DIR}
38    COMMENT "Merging profdata"
39    DEPENDS generate-profraw)
40endif()
41
42find_program(DTRACE dtrace)
43if(DTRACE)
44  configure_lit_site_cfg(
45    ${CMAKE_CURRENT_SOURCE_DIR}/order-files.lit.site.cfg.in
46    ${CMAKE_CURRENT_BINARY_DIR}/order-files/lit.site.cfg
47    )
48
49  add_lit_testsuite(generate-dtrace-logs "Generating clang dtrace data"
50    ${CMAKE_CURRENT_BINARY_DIR}/order-files/
51    ARGS -j 1
52    DEPENDS clang clear-dtrace-logs
53    )
54
55  add_custom_target(clear-dtrace-logs
56    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py clean ${CMAKE_CURRENT_BINARY_DIR} dtrace
57    COMMENT "Clearing old dtrace data")
58
59  add_custom_target(generate-order-file
60    COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/perf-helper.py gen-order-file --binary $<TARGET_FILE:clang> --output ${CLANG_ORDER_FILE} ${CMAKE_CURRENT_BINARY_DIR}
61    COMMENT "Generating order file"
62    DEPENDS generate-dtrace-logs)
63endif()
64