[clang] [perf-training] Fix dependencies when using -DCLANG_PGO_TRAINING_DATA_SOURCE_DIR (PR #108488)

via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 12 21:18:32 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Tom Stellard (tstellar)

<details>
<summary>Changes</summary>

The generate-profraw-external target needs to be built after clang, but this was not modeled correctly in the CMake dependencies.  The new dependency ordering ensures that clang is built before generate-profraw-external.

Old Dependencies:
generate-profdata -> clang -> generate-profraw
                  \-> generate-profraw-external

New Dependencies:
generate-profdata -> clang -> generate-profraw -> generate-profraw-external

---
Full diff: https://github.com/llvm/llvm-project/pull/108488.diff


1 Files Affected:

- (modified) clang/utils/perf-training/CMakeLists.txt (+2-2) 


``````````diff
diff --git a/clang/utils/perf-training/CMakeLists.txt b/clang/utils/perf-training/CMakeLists.txt
index 49673790ff6e84..7790e373add57f 100644
--- a/clang/utils/perf-training/CMakeLists.txt
+++ b/clang/utils/perf-training/CMakeLists.txt
@@ -46,8 +46,8 @@ if(LLVM_BUILD_INSTRUMENTED)
     add_custom_target(generate-profdata DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/clang.profdata)
     if (CLANG_PGO_TRAINING_DATA_SOURCE_DIR)
       llvm_ExternalProject_Add(generate-profraw-external ${CLANG_PGO_TRAINING_DATA_SOURCE_DIR}
-              USE_TOOLCHAIN EXLUDE_FROM_ALL NO_INSTALL DEPENDS generate-profraw)
-      add_dependencies(generate-profdata generate-profraw-external)
+              USE_TOOLCHAIN EXLUDE_FROM_ALL NO_INSTALL)
+      add_dependencies(generate-profraw generate-profraw-external)
     endif()
   endif()
 endif()

``````````

</details>


https://github.com/llvm/llvm-project/pull/108488


More information about the cfe-commits mailing list