[PATCH] D138974: [CMake] Support injecting extra dependencies for perf-training

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 29 22:13:50 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGdabd23917651: [CMake] Support injecting extra dependencies for perf-training (authored by phosek).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D138974?vs=478783&id=478804#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138974/new/

https://reviews.llvm.org/D138974

Files:
  clang/utils/perf-training/CMakeLists.txt
  llvm/docs/AdvancedBuilds.rst


Index: llvm/docs/AdvancedBuilds.rst
===================================================================
--- llvm/docs/AdvancedBuilds.rst
+++ llvm/docs/AdvancedBuilds.rst
@@ -164,6 +164,14 @@
 You can feed that file into the LLVM_PROFDATA_FILE option when you build your
 optimized compiler.
 
+It may be necessary to build additional targets before running perf training, such as
+builtins and runtime libraries. You can use the :code:`CLANG_PERF_TRAINING_DEPS` CMake
+variable for that purpose:
+
+.. code-block:: cmake
+
+  set(CLANG_PERF_TRAINING_DEPS builtins runtimes CACHE STRING "")
+
 The PGO cache has a slightly different stage naming scheme than other
 multi-stage builds. It generates three stages: stage1, stage2-instrumented, and
 stage2. Both of the stage2 builds are built using the stage1 compiler.
Index: clang/utils/perf-training/CMakeLists.txt
===================================================================
--- clang/utils/perf-training/CMakeLists.txt
+++ clang/utils/perf-training/CMakeLists.txt
@@ -11,7 +11,7 @@
   add_lit_testsuite(generate-profraw "Generating clang PGO data"
     ${CMAKE_CURRENT_BINARY_DIR}/pgo-data/
     EXCLUDE_FROM_CHECK_ALL
-    DEPENDS clang clear-profraw
+    DEPENDS clang clear-profraw ${CLANG_PERF_TRAINING_DEPS}
     )
 
   add_custom_target(clear-profraw


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D138974.478804.patch
Type: text/x-patch
Size: 1315 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20221130/7fdf449a/attachment-0001.bin>


More information about the cfe-commits mailing list