Skip to content

Commit 5298942

Browse files
committed
Wrap cmake command with perf instead of clang to save time on perf2bolt conversions
1 parent d4480da commit 5298942

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

clang/utils/perf-training/bolt.lit.cfg

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ clang_nowrapper = os.path.realpath(
2525
lit.util.which(clang_binary, config.clang_tools_dir)
2626
).replace("\\", "/")
2727
config.clang = perf_wrapper + clang_nowrapper
28-
config.cmake_compiler_args = "-DCMAKE_CXX_COMPILER_LAUNCHER='{0}' -DCMAKE_C_COMPILER_LAUNCHER='{0}' -DCMAKE_C_COMPILER='{1}' -DCMAKE_CXX_COMPILER='{1};--driver-mode=g++'".format(
29-
re.sub(r"\s+", ";", perf_wrapper.rstrip()),
28+
config.cmake_compiler_args = "-DCMAKE_C_COMPILER='{0}' -DCMAKE_CXX_COMPILER='{0};--driver-mode=g++'".format(
3029
re.sub(r"\s+", ";", clang_nowrapper)
3130
)
3231

@@ -70,3 +69,4 @@ config.substitutions.append(('%cmake_generator', config.cmake_generator))
7069
config.substitutions.append(('%cmake', config.cmake_exe))
7170
config.substitutions.append(('%llvm_src_dir', config.llvm_src_dir))
7271
config.substitutions.append(('%ninja_args', ninja_args))
72+
config.substitutions.append(('%perf_wrapper', perf_wrapper))

clang/utils/perf-training/lit.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ config.substitutions.append( ('%cmake_generator', config.cmake_generator ) )
4444
config.substitutions.append( ('%cmake', config.cmake_exe ) )
4545
config.substitutions.append( ('%llvm_src_dir', config.llvm_src_dir ) )
4646
config.substitutions.append( ('%ninja_args', '' ) )
47+
config.substitutions.append( ('%perf_wrapper', '' ) )
4748

4849
config.environment['LLVM_PROFILE_FILE'] = 'perf-training-%4m.profraw'
4950

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
RUN: %cmake -G %cmake_generator -B %t -S %llvm_src_dir %cmake_compiler_args -DCMAKE_BUILD_TYPE=Release
2-
RUN: %cmake --build %t %ninja_args -v --target LLVMSupport
2+
RUN: %perf_wrapper %cmake --build %t -v --target LLVMSupport

0 commit comments

Comments
 (0)