Skip to content

Commit 6ed7594

Browse files
authored
Hack: ignore illegal calls to report_exception to fix Enzyme.jl (#619)
1 parent 27d4b19 commit 6ed7594

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rtlib.jl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ function LLVM.call!(builder, rt::Runtime.RuntimeMethodInstance, args=LLVM.Value[
3131
ft = convert(LLVM.FunctionType, rt)
3232
f = LLVM.Function(mod, rt.llvm_name, ft)
3333
end
34-
if !isdeclaration(f) && rt.name !== :gc_pool_alloc
34+
if !isdeclaration(f) && (rt.name !== :gc_pool_alloc && rt.name !== :report_exception)
3535
# XXX: uses of the gc_pool_alloc intrinsic can be introduced _after_ the runtime
3636
# is linked, as part of the lower_gc_frame! optimization pass.
37+
# XXX: report_exception can also be used after the runtime is linked during
38+
# CUDA/Enzyme nested compilation
3739
error("Calling an intrinsic function that clashes with an existing definition: ",
3840
string(ft), " ", rt.name)
3941
end

0 commit comments

Comments
 (0)