10 clang_bolt_mode = config.clang_bolt_mode.lower()
11 clang_binary = "clang"
12 perf_wrapper = f"{config.python_exe} {config.perf_helper_dir}/perf-helper.py perf "
14 if clang_bolt_mode == "instrument":
16 clang_binary = config.clang_bolt_name
17 elif clang_bolt_mode == "lbr":
18 perf_wrapper += " --lbr -- "
19 elif clang_bolt_mode == "perf":
20 perf_wrapper += " -- "
22 assert 0, "Unsupported CLANG_BOLT_MODE variable"
24 clang_nowrapper = os.path.realpath(
25 lit.util.which(clang_binary, config.clang_tools_dir)
27 config.clang = perf_wrapper + clang_nowrapper
28 config.cmake_compiler_args = "-DCMAKE_C_COMPILER='{0}' -DCMAKE_CXX_COMPILER='{0};--driver-mode=g++'".format(
29 re.sub(r"\s+", ";", clang_nowrapper)
32 config.name = "Clang Perf Training"
48 use_lit_shell = os.environ.get("LIT_USE_INTERNAL_SHELL")
49 config.test_format = lit.formats.ShTest(use_lit_shell == "0")
50 config.substitutions.append(
51 ("%clang_cpp_skip_driver", f" {config.clang} --driver-mode=g++ ")
53 config.substitutions.append(("%clang_cpp", f" {config.clang} --driver-mode=g++ "))
54 config.substitutions.append(("%clang_skip_driver", config.clang))
55 config.substitutions.append(("%clang", config.clang))
56 config.substitutions.append(("%test_root", config.test_exec_root))
57 config.substitutions.append(("%cmake_compiler_args", config.cmake_compiler_args))
58 config.substitutions.append(('%cmake_generator', config.cmake_generator))
59 config.substitutions.append(('%cmake', config.cmake_exe))
60 config.substitutions.append(('%llvm_src_dir', config.llvm_src_dir))
61 config.substitutions.append(('%perf_wrapper', perf_wrapper))