Repository navigation
[compiler] build tools for code cov - #4931
Conversation
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
| LLVM_COV | ||
| LLVM_CXXFILT | ||
| LLVM_DIS | ||
| LLVM_DWARFDUMP | ||
| LLVM_LINK | ||
| LLVM_MC | ||
| LLVM_NM | ||
| LLVM_OFFLOAD_BINARY | ||
| LLVM_PROFDATA |
There was a problem hiding this comment.
This seems to be working, see
- https://github.com/ROCm/TheRock/actions/runs/25121748018?pr=4931
- https://therock-ci-artifacts-external.s3.amazonaws.com/ROCm-TheRock/25121748018-linux/index.html
amd-llvm_run_generic.tar.zstcompiler/amd-llvm/stage/lib/llvm/bin/hasllvm-cov,llvm-cxxfilt, andllvm-profdata
geomin12
left a comment
There was a problem hiding this comment.
looks like it is working but i'll let other folks review this for build
|
The build failures seem infra-related, so retrying those failed jobs. |
jayhawk-commits
left a comment
There was a problem hiding this comment.
LGTM, with the produced artifacts including the added tools
Looping in compiler team for awareness. CC @ronlieb @skganesan008
|
The S3 upload issues from this fork for the native packaging potentially fixed when #5066 lands. More concerned about the signal from the Windows build at this time. |
|
@reboss , No JIRA information available in this PR, and the Test Plan / Test Result sections were left empty. Please add for traceability. No automated tests were added with this PR. Verification that Since this is already merged, as a follow-up can you add a unit test (or extend
This guards the intent of this PR — that the coverage tools remain present in the published artifact for downstream code-coverage jobs (e.g. ROCm/rocm-libraries#4441). |
Work tracking for open source code belongs on GitHub. Mirroring to Jira is optional, and TheRock uses GitHub exclusively.
I'm all for adding test coverage, but we don't currently test that every LLVM tool is built, only those that are user-facing. See the list of what is built here: TheRock/compiler/pre_hook_amd-llvm.cmake Lines 150 to 170 in 6043982 And what we have tests for here: The "tests" for these internal tools getting built is that they are used within the build/test systems. The artifact structure test would be the wrong place to add coverage anyways. I linked to the user-facing install tests above, and project-specific tests would go in either TheRock/compiler/CMakeLists.txt Lines 190 to 205 in 6043982 |
Motivation
For code coverage jobs, we'll need to have these tools available. It would be nice if they were already pre-built, so my goal for this PR is to make TheRock build aware of these tools and then publish them to be consumed in CI, without having to build them from scratch every time.
Technical Details
Just updates the CMake flow to build these artifacts.
Test Plan
Test Result
Submission Checklist