Skip to content

Commit

Permalink
Hack: ignore illegal calls to report_exception to fix Enzyme.jl (#619)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Aug 26, 2024
1 parent 27d4b19 commit 6ed7594
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rtlib.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ function LLVM.call!(builder, rt::Runtime.RuntimeMethodInstance, args=LLVM.Value[
ft = convert(LLVM.FunctionType, rt)
f = LLVM.Function(mod, rt.llvm_name, ft)
end
if !isdeclaration(f) && rt.name !== :gc_pool_alloc
if !isdeclaration(f) && (rt.name !== :gc_pool_alloc && rt.name !== :report_exception)
# XXX: uses of the gc_pool_alloc intrinsic can be introduced _after_ the runtime
# is linked, as part of the lower_gc_frame! optimization pass.
# XXX: report_exception can also be used after the runtime is linked during
# CUDA/Enzyme nested compilation
error("Calling an intrinsic function that clashes with an existing definition: ",
string(ft), " ", rt.name)
end
Expand Down

0 comments on commit 6ed7594

Please sign in to comment.