From 6f7e7096b62367c79c7c588702e2331375a51582 Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Thu, 20 Aug 2026 22:34:14 +0000 Subject: [PATCH 1/2] [GCN] accept llvm.frexp and llvm.ldexp as intrinsics 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) --- src/gcn.jl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gcn.jl b/src/gcn.jl index 20b25e71..64113690 100644 --- a/src/gcn.jl +++ b/src/gcn.jl @@ -39,8 +39,13 @@ end ## job -isintrinsic(@nospecialize(job::CompilerJob{GCNCompilerTarget}), fn::String) = - return startswith(fn, "llvm.amdgcn.") +function isintrinsic(@nospecialize(job::CompilerJob{GCNCompilerTarget}), fn::String) + startswith(fn, "llvm.amdgcn.") && return true + # The ROCm device libraries use `llvm.frexp` and `llvm.ldexp`, which were only added in + # LLVM 17, so they are not recognized as intrinsics by older versions of LLVM. + # Final code generation knows how to lower them, so accept them here. + return startswith(fn, "llvm.frexp.") || startswith(fn, "llvm.ldexp.") +end pass_by_ref(@nospecialize(job::CompilerJob{GCNCompilerTarget})) = true From 29bf6b8a1fddace428f8163b2ddf6c02015e416b Mon Sep 17 00:00:00 2001 From: Simeon David Schaub Date: Fri, 21 Aug 2026 09:44:58 +0200 Subject: [PATCH 2/2] Bump version. --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 83cb5a05..89dde42b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "GPUCompiler" uuid = "61eb1bfa-7361-4325-ad38-22787b887f55" -version = "2.2.1" +version = "2.2.2" authors = ["Tim Besard "] [workspace]