[clang] 2c59c4f - [perf-training] Make training data location configurable
Shoaib Meenai via cfe-commits
cfe-commits at lists.llvm.org
Sat Dec 14 09:47:11 PST 2019
Author: Shoaib Meenai
Date: 2019-12-14T09:46:41-08:00
New Revision: 2c59c4ffb9c111f8d87a65839697d03fc485c51c
URL: https://github.com/llvm/llvm-project/commit/2c59c4ffb9c111f8d87a65839697d03fc485c51c
DIFF: https://github.com/llvm/llvm-project/commit/2c59c4ffb9c111f8d87a65839697d03fc485c51c.diff
LOG: [perf-training] Make training data location configurable
We may wish to keep the PGO training data outside the repository. Add a
CMake variable to allow referencing an external lit testsuite.
Differential Revision: https://reviews.llvm.org/D71507
Added:
Modified:
clang/utils/perf-training/CMakeLists.txt
clang/utils/perf-training/lit.cfg
clang/utils/perf-training/lit.site.cfg.in
clang/utils/perf-training/order-files.lit.cfg
clang/utils/perf-training/order-files.lit.site.cfg.in
Removed:
################################################################################
diff --git a/clang/utils/perf-training/CMakeLists.txt b/clang/utils/perf-training/CMakeLists.txt
index 39f9a4ca3c13..25bb7f49a5ef 100644
--- a/clang/utils/perf-training/CMakeLists.txt
+++ b/clang/utils/perf-training/CMakeLists.txt
@@ -10,6 +10,10 @@ endif ()
string(REPLACE ${CMAKE_CFG_INTDIR} ${LLVM_BUILD_MODE} CLANG_TOOLS_DIR ${LLVM_RUNTIME_OUTPUT_INTDIR})
+set(CLANG_PGO_TRAINING_DATA "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH
+ "The path to a lit testsuite containing samples for PGO and order file generation"
+ )
+
if(LLVM_BUILD_INSTRUMENTED)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
diff --git a/clang/utils/perf-training/lit.cfg b/clang/utils/perf-training/lit.cfg
index 671d44f83b94..67a42345da46 100644
--- a/clang/utils/perf-training/lit.cfg
+++ b/clang/utils/perf-training/lit.cfg
@@ -27,7 +27,7 @@ config.clang = lit.util.which('clang', config.clang_tools_dir).replace('\\', '/'
config.name = 'Clang Perf Training'
config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap']
-cc1_wrapper = '%s %s/perf-helper.py cc1' % (config.python_exe, config.test_source_root)
+cc1_wrapper = '%s %s/perf-helper.py cc1' % (config.python_exe, config.perf_helper_dir)
use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
config.test_format = lit.formats.ShTest(use_lit_shell == "0")
diff --git a/clang/utils/perf-training/lit.site.cfg.in b/clang/utils/perf-training/lit.site.cfg.in
index 66683bcd5286..340a0e909b10 100644
--- a/clang/utils/perf-training/lit.site.cfg.in
+++ b/clang/utils/perf-training/lit.site.cfg.in
@@ -3,8 +3,9 @@
import sys
config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
+config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
-config.test_source_root = "@CMAKE_CURRENT_SOURCE_DIR@"
+config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
config.target_triple = "@TARGET_TRIPLE@"
config.python_exe = "@PYTHON_EXECUTABLE@"
diff --git a/clang/utils/perf-training/order-files.lit.cfg b/clang/utils/perf-training/order-files.lit.cfg
index 93904ec84a41..03c605c01c56 100644
--- a/clang/utils/perf-training/order-files.lit.cfg
+++ b/clang/utils/perf-training/order-files.lit.cfg
@@ -28,8 +28,8 @@ config.clang = os.path.realpath(lit.util.which('clang', config.clang_tools_dir))
config.name = 'Clang Perf Training'
config.suffixes = ['.c', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap']
-dtrace_wrapper = '%s %s/perf-helper.py dtrace' % (config.python_exe, config.test_source_root)
-dtrace_wrapper_cc1 = '%s %s/perf-helper.py dtrace --cc1' % (config.python_exe, config.test_source_root)
+dtrace_wrapper = '%s %s/perf-helper.py dtrace' % (config.python_exe, config.perf_helper_dir)
+dtrace_wrapper_cc1 = '%s %s/perf-helper.py dtrace --cc1' % (config.python_exe, config.perf_helper_dir)
if 'darwin' in config.target_triple:
lit_config.note('using DTrace oneshot probe')
diff --git a/clang/utils/perf-training/order-files.lit.site.cfg.in b/clang/utils/perf-training/order-files.lit.site.cfg.in
index 0490a217ad04..87406dbaf9a6 100644
--- a/clang/utils/perf-training/order-files.lit.site.cfg.in
+++ b/clang/utils/perf-training/order-files.lit.site.cfg.in
@@ -3,8 +3,9 @@
import sys
config.clang_tools_dir = "@CLANG_TOOLS_DIR@"
+config.perf_helper_dir = "@CMAKE_CURRENT_SOURCE_DIR@"
config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@"
-config.test_source_root = "@CMAKE_CURRENT_SOURCE_DIR@"
+config.test_source_root = "@CLANG_PGO_TRAINING_DATA@"
config.target_triple = "@TARGET_TRIPLE@"
config.python_exe = "@PYTHON_EXECUTABLE@"
More information about the cfe-commits
mailing list