[CMake][PGO] Add option for using an external project to generate profile data (...
commitad0fb418badbb695b5db9335985e67c67e69c554
authorTom Stellard <tstellar@redhat.com>
Fri, 2 Feb 2024 19:35:08 +0000 (2 11:35 -0800)
committerTom Stellard <tstellar@redhat.com>
Tue, 6 Feb 2024 19:49:07 +0000 (6 11:49 -0800)
tree8f8f5b4a04def2c2d6f8faf5abeb7dbbed6164aa
parentc072ff2c5f8057a1c8ebfdaf44719b75ab9439ee
[CMake][PGO] Add option for using an external project to generate profile data (#78879)

The new CLANG_PGO_TRAINING_DATA_SOURCE_DIR allows users to specify a
CMake project to use for generating the profile data. For example, to
use the llvm-test-suite to generate profile data you would do:

$ cmake -G Ninja -B build -S llvm -C <path to
source>/clang/cmake/caches/PGO.cmake \
-DBOOTSTRAP_CLANG_PGO_TRAINING_DATA_SOURCE_DIR=<path to llvm-test-suite>
\
        -DBOOTSTRAP_CLANG_PGO_TRAINING_DEPS=runtimes

Note that the CLANG_PERF_TRAINING_DEPS has been renamed to
CLANG_PGO_TRAINING_DEPS.

---------

Co-authored-by: Petr Hosek <phosek@google.com>
(cherry picked from commit dd0356d741aefa25ece973d6cc4b55dcb73b84b4)
clang/utils/perf-training/CMakeLists.txt
clang/utils/perf-training/perf-helper.py
llvm/docs/AdvancedBuilds.rst