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

2022-11-29 Thread Petr Hosek via Phabricator via cfe-commits
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


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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-11-29 Thread Shoaib Meenai via Phabricator via cfe-commits
smeenai accepted this revision.
smeenai added a comment.
This revision is now accepted and ready to land.

Might be worth a mention in either 
https://llvm.org/docs/AdvancedBuilds.html#multi-stage-pgo, to make it a bit 
more discoverable.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D138974

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


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

2022-11-29 Thread Petr Hosek via Phabricator via cfe-commits
phosek created this revision.
phosek added a reviewer: smeenai.
Herald added a project: All.
phosek requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

It may be necessary to build additional targets before running
perf-training, the typical use case would be builtins and runtimes.

This change allows users to specify those dependencies as:

  set(CLANG_PERF_TRAINING_DEPS builtins runtimes CACHE STRING "")


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D138974

Files:
  clang/utils/perf-training/CMakeLists.txt


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


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
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits