File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -784,6 +784,12 @@ class BuildScriptInvocation(object):
784
784
if args .dry_run :
785
785
impl_args += ["--dry-run" ]
786
786
787
+ if args .clang_profile_instr_use :
788
+ impl_args += [
789
+ "--clang-profile-instr-use=%s" %
790
+ os .path .abspath (args .clang_profile_instr_use )
791
+ ]
792
+
787
793
if args .lit_args :
788
794
impl_args += ["--llvm-lit-args=%s" % args .lit_args ]
789
795
@@ -1922,6 +1928,11 @@ details of the setups of other systems or automated environments.""")
1922
1928
const = 'full' ,
1923
1929
dest = 'lto_type' )
1924
1930
1931
+ parser .add_argument (
1932
+ "--clang-profile-instr-use" ,
1933
+ help = "profile file to use for clang PGO" ,
1934
+ metavar = "PATH" )
1935
+
1925
1936
default_max_lto_link_job_counts = host .max_lto_link_job_counts ()
1926
1937
parser .add_argument (
1927
1938
"--llvm-max-parallel-lto-link-jobs" ,
Original file line number Diff line number Diff line change @@ -225,6 +225,7 @@ KNOWN_SETTINGS=(
225
225
only-execute " all" " Only execute the named action (see implementation)"
226
226
llvm-lit-args " " " If set, override the lit args passed to LLVM"
227
227
llvm-targets-to-build " X86;ARM;AArch64;PowerPC;SystemZ" " The code generators that LLVM should build"
228
+ clang-profile-instr-use " " " If set, profile file to use for clang PGO"
228
229
build-toolchain-only " " " If set, only build the necessary tools to build an external toolchain"
229
230
)
230
231
@@ -787,6 +788,12 @@ function set_build_options_for_host() {
787
788
-DLLVM_LIT_ARGS=" ${LLVM_LIT_ARGS} "
788
789
)
789
790
fi
791
+
792
+ if [[ " ${CLANG_PROFILE_INSTR_USE} " ]]; then
793
+ llvm_cmake_options+=(
794
+ -DLLVM_PROFDATA_FILE=" ${CLANG_PROFILE_INSTR_USE} "
795
+ )
796
+ fi
790
797
}
791
798
792
799
function configure_default_options() {
You can’t perform that action at this time.
0 commit comments