From 6ed7594db9a79e035b7ff2df586f6b4385169904 Mon Sep 17 00:00:00 2001 From: William Moses Date: Mon, 26 Aug 2024 01:59:18 -0500 Subject: [PATCH] Hack: ignore illegal calls to report_exception to fix Enzyme.jl (#619) --- src/rtlib.jl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/rtlib.jl b/src/rtlib.jl index 2d15fa72..4987a7dd 100644 --- a/src/rtlib.jl +++ b/src/rtlib.jl @@ -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