diff options
author | Brett Cannon <brett@python.org> | 2015-09-18 15:13:44 -0700 |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2015-09-18 15:13:44 -0700 |
commit | 5f6fd63f998e32bbe732fe7e9ac3d3de4841e37b (patch) | |
tree | bb228d4f210992a40f72db87cfc1b49a478679d1 /configure.ac | |
parent | 6184dd47c238f3bb6116c5f1e753dfa498e95859 (diff) | |
download | cpython-5f6fd63f998e32bbe732fe7e9ac3d3de4841e37b.tar.gz |
Issue #24915: Add Clang support to PGO builds and use the test suite
for profile data.
Thanks to Alecsandru Patrascu of Intel for the initial patch.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 56a73df233..792f580c12 100644 --- a/configure.ac +++ b/configure.ac @@ -1218,6 +1218,49 @@ else AC_MSG_RESULT(no); Py_DEBUG='false' fi], [AC_MSG_RESULT(no)]) +# Enable PGO flags. +AC_SUBST(PGO_PROF_GEN_FLAG) +AC_SUBST(PGO_PROF_USE_FLAG) +AC_SUBST(LLVM_PROF_MERGER) +AC_SUBST(LLVM_PROF_FILE) +AC_SUBST(LLVM_PROF_ERR) +AC_SUBST(LLVM_PROF_FOUND) +AC_CHECK_PROG(LLVM_PROF_FOUND, llvm-profdata, found, not-found) +LLVM_PROF_ERR=no +case $CC in + *clang*) + # Any changes made here should be reflected in the GCC+Darwin case below + PGO_PROF_GEN_FLAG="-fprofile-instr-generate" + PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclangr" + LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" + if test $LLVM_PROF_FOUND = not-found + then + LLVM_PROF_ERR=yes + fi + ;; + *gcc*) + case $ac_sys_system in + Darwin*) + PGO_PROF_GEN_FLAG="-fprofile-instr-generate" + PGO_PROF_USE_FLAG="-fprofile-instr-use=code.profclangd" + LLVM_PROF_MERGER="llvm-profdata merge -output=code.profclangd *.profclangr" + LLVM_PROF_FILE="LLVM_PROFILE_FILE=\"code-%p.profclangr\"" + if test $LLVM_PROF_FOUND = not-found + then + LLVM_PROF_ERR=yes + fi + ;; + *) + PGO_PROF_GEN_FLAG="-fprofile-generate" + PGO_PROF_USE_FLAG="-fprofile-use -fprofile-correction" + LLVM_PROF_MERGER="true" + LLVM_PROF_FILE="" + ;; + esac + ;; +esac + # XXX Shouldn't the code above that fiddles with BASECFLAGS and OPT be # merged with this chunk of code? |