Skip to content

[GCN] allow llvm.frexp and llvm.ldexp intrinsics - #900

Merged
simeonschaub merged 2 commits into
JuliaGPU:mainfrom
simeonschaub:sds/gcn_frexp_ldexp
Aug 21, 2026
Merged

[GCN] allow llvm.frexp and llvm.ldexp intrinsics#900
simeonschaub merged 2 commits into
JuliaGPU:mainfrom
simeonschaub:sds/gcn_frexp_ldexp

Conversation

@simeonschaub

Copy link
Copy Markdown
Member

Encountered in JuliaGPU/AMDGPU.jl#1023. These intrinsics are not recognized by the older LLVM versions of Julia 1.10 and 1.11, so they resulted in an InvalidIRError. They do occur in the more recent device libs though and the backend knows how to lower them, so accepts these as well

The ROCm device libraries (OCML) implement ldexp, pown, hypot, fmod,
cbrt, complex math etc. via the generic `llvm.frexp` and `llvm.ldexp`
intrinsics, which only exist since LLVM 17. On older LLVM versions
(Julia 1.10/1.11) `LLVMGetIntrinsicID` does not know them, so
`check_ir` rejected every kernel touching them with

    InvalidIRError: unsupported call to an unknown function
    (call to llvm.ldexp.f32.i32)

Final code generation handles them fine, so whitelist these two
intrinsic families for the GCN target.

Assisted-by: Claude Code (claude-fable-5)
@codecov

codecov Bot commented Aug 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 84.01%. Comparing base (3e924f2) to head (29bf6b8).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/gcn.jl 0.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #900      +/-   ##
==========================================
- Coverage   84.04%   84.01%   -0.04%     
==========================================
  Files          28       28              
  Lines        5379     5381       +2     
==========================================
  Hits         4521     4521              
- Misses        858      860       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@simeonschaub
simeonschaub merged commit 410ba6d into JuliaGPU:main Aug 21, 2026
29 of 30 checks passed
@simeonschaub
simeonschaub deleted the sds/gcn_frexp_ldexp branch August 21, 2026 07:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant