Skip to content

Commit 730f2f6

Browse files
committed
Show LLVM profile statistics after PGO training
1 parent 69d0f96 commit 730f2f6

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

‎Makefile.pre.in‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ GITBRANCH= @GITBRANCH@
5050
PGO_PROF_GEN_FLAG=@PGO_PROF_GEN_FLAG@
5151
PGO_PROF_USE_FLAG=@PGO_PROF_USE_FLAG@
5252
LLVM_PROF_MERGER=@LLVM_PROF_MERGER@
53+
LLVM_PROF_SHOW=@LLVM_PROF_SHOW@
5354
LLVM_PROF_FILE=@LLVM_PROF_FILE@
5455
LLVM_PROF_ERR=@LLVM_PROF_ERR@
5556
DTRACE= @DTRACE@
@@ -849,6 +850,7 @@ profile-run-stamp:
849850
@ # FIXME: can't run for a cross build
850851
$(LLVM_PROF_FILE) $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK)
851852
$(LLVM_PROF_MERGER)
853+
$(LLVM_PROF_SHOW)
852854
# Remove profile generation binary since we are done with it.
853855
$(MAKE) clean-retain-profile
854856
# This is an expensive target to build and it does not have proper

‎configure‎

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎configure.ac‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2099,6 +2099,7 @@ fi
20992099
AC_SUBST([PGO_PROF_GEN_FLAG])
21002100
AC_SUBST([PGO_PROF_USE_FLAG])
21012101
AC_SUBST([LLVM_PROF_MERGER])
2102+
AC_SUBST([LLVM_PROF_SHOW])
21022103
AC_SUBST([LLVM_PROF_FILE])
21032104
AC_SUBST([LLVM_PROF_ERR])
21042105
AC_SUBST([LLVM_PROFDATA])
@@ -2123,6 +2124,7 @@ then
21232124
fi
21242125
fi
21252126
LLVM_PROF_ERR=no
2127+
LLVM_PROF_SHOW=true
21262128

21272129
case "$ac_cv_cc_name" in
21282130
clang|icx)
@@ -2135,6 +2137,10 @@ case "$ac_cv_cc_name" in
21352137
\"\$(shell pwd)\"/*.profclangr
21362138
")
21372139
LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"\$(shell pwd)/code-%p.profclangr\""
2140+
LLVM_PROF_SHOW=m4_normalize("
2141+
${LLVM_PROFDATA} show --detailed-summary --topn=500
2142+
\"\$(shell pwd)/code.profclangd\"
2143+
")
21382144
if test $LLVM_PROF_FOUND = not-found
21392145
then
21402146
LLVM_PROF_ERR=yes

0 commit comments

Comments
 (0)