Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][perf-training] Support excluding LLVM build from PGO training #126876

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions clang/utils/perf-training/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ set(CLANG_PGO_TRAINING_DATA "${CMAKE_CURRENT_SOURCE_DIR}" CACHE PATH
set(CLANG_PGO_TRAINING_DATA_SOURCE_DIR OFF CACHE STRING "Path to source directory containing cmake project with source files to use for generating pgo data")
set(CLANG_PGO_TRAINING_DEPS "" CACHE STRING "Extra dependencies needed to build the PGO training data.")

option(CLANG_PGO_TRAINING_USE_LLVM_BUILD "Use LLVM build for generating PGO data" ON)

llvm_canonicalize_cmake_booleans(
CLANG_PGO_TRAINING_USE_LLVM
)

if(LLVM_BUILD_INSTRUMENTED)
configure_lit_site_cfg(
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in
Expand Down
3 changes: 3 additions & 0 deletions clang/utils/perf-training/lit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ config.clang = lit.util.which('clang', config.clang_tools_dir).replace('\\', '/'
config.name = 'Clang Perf Training'
config.suffixes = ['.c', '.cc', '.cpp', '.m', '.mm', '.cu', '.ll', '.cl', '.s', '.S', '.modulemap', '.test']

if not config.use_llvm_build:
config.excludes = ['llvm-support']

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")
Expand Down
1 change: 1 addition & 0 deletions clang/utils/perf-training/lit.site.cfg.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ config.python_exe = "@Python3_EXECUTABLE@"
config.cmake_exe = "@CMAKE_COMMAND@"
config.llvm_src_dir ="@CMAKE_SOURCE_DIR@"
config.cmake_generator ="@CMAKE_GENERATOR@"
config.use_llvm_build = @CLANG_PGO_TRAINING_USE_LLVM_BUILD@

# Let the main config do the real work.
lit_config.load_config(config, "@CLANG_SOURCE_DIR@/utils/perf-training/lit.cfg")