-
-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build libLLVMSupport to generate profiling data, previously we were only compiling a very simple HelloWorld program for profiling. This speeds up building llvm with clang by 1.22x Additionally build with thin LTO instead of full as the memory requirements for fat LTO are too high with little gain.
- Loading branch information
1 parent
15771c2
commit 9626ab4
Showing
4 changed files
with
81 additions
and
25 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
l/llvm/pkg/perf/build-libLLVMSupport-for-perf-training.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
diff --git a/clang/utils/perf-training/lit.cfg b/clang/utils/perf-training/lit.cfg | ||
index 0bd06c0d44f650..b4527c602fc484 100644 | ||
--- a/clang/utils/perf-training/lit.cfg | ||
+++ b/clang/utils/perf-training/lit.cfg | ||
@@ -34,8 +34,12 @@ config.test_format = lit.formats.ShTest(use_lit_shell == "0") | ||
config.substitutions.append( ('%clang_cpp_skip_driver', ' %s %s %s ' % (cc1_wrapper, config.clang, sysroot_flags))) | ||
config.substitutions.append( ('%clang_cpp', ' %s --driver-mode=g++ %s ' % (config.clang, sysroot_flags))) | ||
config.substitutions.append( ('%clang_skip_driver', ' %s %s %s ' % (cc1_wrapper, config.clang, sysroot_flags))) | ||
-config.substitutions.append( ('%clang', ' %s %s ' % (config.clang, sysroot_flags) ) ) | ||
+config.substitutions.append( ('%clang', '%s %s ' % (config.clang, sysroot_flags) ) ) | ||
config.substitutions.append( ('%test_root', config.test_exec_root ) ) | ||
+config.substitutions.append( ('%cmake_generator', config.cmake_generator ) ) | ||
+config.substitutions.append( ('%cmake', config.cmake_exe ) ) | ||
+config.substitutions.append( ('%llvm_src_dir', config.llvm_src_dir ) ) | ||
|
||
+print(config.substitutions) | ||
config.environment['LLVM_PROFILE_FILE'] = 'perf-training-%4m.profraw' | ||
|
||
diff --git a/clang/utils/perf-training/lit.site.cfg.in b/clang/utils/perf-training/lit.site.cfg.in | ||
index fae93065a4edf2..9d279d552919ac 100644 | ||
--- a/clang/utils/perf-training/lit.site.cfg.in | ||
+++ b/clang/utils/perf-training/lit.site.cfg.in | ||
@@ -8,6 +8,9 @@ config.test_exec_root = "@CMAKE_CURRENT_BINARY_DIR@" | ||
config.test_source_root = "@CLANG_PGO_TRAINING_DATA@" | ||
config.target_triple = "@LLVM_TARGET_TRIPLE@" | ||
config.python_exe = "@Python3_EXECUTABLE@" | ||
+config.cmake_exe = "@CMAKE_COMMAND@" | ||
+config.llvm_src_dir ="@CMAKE_SOURCE_DIR@" | ||
+config.cmake_generator ="@CMAKE_GENERATOR@" | ||
|
||
# Let the main config do the real work. | ||
lit_config.load_config(config, "@CLANG_SOURCE_DIR@/utils/perf-training/lit.cfg") | ||
diff --git a/clang/utils/perf-training/llvm-support/build.test b/clang/utils/perf-training/llvm-support/build.test | ||
new file mode 100644 | ||
index 00000000000000..f29a594c846869 | ||
--- /dev/null | ||
+++ b/clang/utils/perf-training/llvm-support/build.test | ||
@@ -0,0 +1,2 @@ | ||
+RUN: %cmake -G %cmake_generator -B %t -S %llvm_src_dir -DCMAKE_C_COMPILER=%clang -DCMAKE_CXX_COMPILER=%clang -DCMAKE_CXX_FLAGS="--driver-mode=g++" -DCMAKE_BUILD_TYPE=Release | ||
+RUN: %cmake --build %t -v --target LLVMSupport | ||
|
||
From 37919a76e3d3aa9456e1c598eab28a2c1f5155bc Mon Sep 17 00:00:00 2001 | ||
From: Tom Stellard <[email protected]> | ||
Date: Wed, 9 Oct 2024 21:50:36 +0000 | ||
Subject: [PATCH 2/2] Remove debug statement | ||
|
||
--- | ||
clang/utils/perf-training/lit.cfg | 1 - | ||
1 file changed, 1 deletion(-) | ||
|
||
diff --git a/clang/utils/perf-training/lit.cfg b/clang/utils/perf-training/lit.cfg | ||
index b4527c602fc484..654961e215da68 100644 | ||
--- a/clang/utils/perf-training/lit.cfg | ||
+++ b/clang/utils/perf-training/lit.cfg | ||
@@ -40,6 +40,5 @@ config.substitutions.append( ('%cmake_generator', config.cmake_generator ) ) | ||
config.substitutions.append( ('%cmake', config.cmake_exe ) ) | ||
config.substitutions.append( ('%llvm_src_dir', config.llvm_src_dir ) ) | ||
|
||
-print(config.substitutions) | ||
config.environment['LLVM_PROFILE_FILE'] = 'perf-training-%4m.profraw' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters