From 9c4ad60c68981c90c79d72b0c7a5907827e0c035 Mon Sep 17 00:00:00 2001 From: John Robbins Date: Tue, 14 Apr 2026 13:32:41 -0600 Subject: [PATCH 1/3] Enable LLVM coverage tools in amd-llvm build Add explicit flags to build llvm-cov and llvm-profdata tools: - LLVM_TOOL_LLVM_COV_BUILD=ON - LLVM_TOOL_LLVM_PROFDATA_BUILD=ON These tools are required for code coverage builds in rocm-libraries projects (hipDNN, rocPRIM, etc.) that use -fprofile-instr-generate and -fcoverage-mapping flags. Co-Authored-By: Claude Sonnet 4 --- compiler/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/CMakeLists.txt b/compiler/CMakeLists.txt index 53042d8f331..23ab9a29085 100644 --- a/compiler/CMakeLists.txt +++ b/compiler/CMakeLists.txt @@ -89,6 +89,10 @@ if(THEROCK_ENABLE_COMPILER) -DLLVM_INCLUDE_EXAMPLES=${THEROCK_ENABLE_LLVM_TESTS} -DLLVM_TOOL_LLVM_JITLINK_BUILD=${THEROCK_ENABLE_LLVM_TESTS} + # Coverage tools (needed for code coverage builds) + -DLLVM_TOOL_LLVM_COV_BUILD=ON + -DLLVM_TOOL_LLVM_PROFDATA_BUILD=ON + # Clang features. -DCLANG_ENABLE_ARCMT=OFF -DCLANG_ENABLE_STATIC_ANALYZER=OFF From caf11aee7a1dbbf89632aee8e46c42099313a460 Mon Sep 17 00:00:00 2001 From: John Robbins Date: Wed, 15 Apr 2026 08:47:40 -0600 Subject: [PATCH 2/3] Add llvm-cov and llvm-profdata to required LLVM tools Include LLVM_COV and LLVM_PROFDATA in the _llvm_required_tools list so these tools are built and installed even when THEROCK_ENABLE_LLVM_TESTS is OFF. Without this, the pre_hook explicitly disables all tools not in the required list, preventing llvm-cov and llvm-profdata from being built despite the CMake flags in CMakeLists.txt. Co-Authored-By: Claude Sonnet 4 --- compiler/pre_hook_amd-llvm.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/compiler/pre_hook_amd-llvm.cmake b/compiler/pre_hook_amd-llvm.cmake index 28dc936b7d5..64049cf9934 100644 --- a/compiler/pre_hook_amd-llvm.cmake +++ b/compiler/pre_hook_amd-llvm.cmake @@ -181,12 +181,14 @@ if(NOT THEROCK_BUILD_LLVM_TESTS AND NOT THEROCK_BUILD_LLVM_TOOLS AND NOT THEROCK LLVM_AR LLVM_AS LLVM_CONFIG + LLVM_COV LLVM_DIS LLVM_DWARFDUMP LLVM_LINK LLVM_MC LLVM_NM LLVM_OFFLOAD_BINARY + LLVM_PROFDATA LLVM_SHLIB LLVM_OBJCOPY LLVM_OBJDUMP From 4d29770657943ed7a0e5f4e91cb93972d013d7c7 Mon Sep 17 00:00:00 2001 From: John Robbins Date: Wed, 15 Apr 2026 09:32:32 -0600 Subject: [PATCH 3/3] Add llvm-cxxfilt to required LLVM tools Include LLVM_CXXFILT in the _llvm_required_tools list as it's required by hipDNN's coverage build configuration. Co-Authored-By: Claude Sonnet 4 --- compiler/pre_hook_amd-llvm.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/pre_hook_amd-llvm.cmake b/compiler/pre_hook_amd-llvm.cmake index 64049cf9934..e7639ce4fef 100644 --- a/compiler/pre_hook_amd-llvm.cmake +++ b/compiler/pre_hook_amd-llvm.cmake @@ -182,6 +182,7 @@ if(NOT THEROCK_BUILD_LLVM_TESTS AND NOT THEROCK_BUILD_LLVM_TOOLS AND NOT THEROCK LLVM_AS LLVM_CONFIG LLVM_COV + LLVM_CXXFILT LLVM_DIS LLVM_DWARFDUMP LLVM_LINK