Skip to content

Commit d0a4612

Browse files
committed
Link the runtime when specific intrinsics occur.
These intrinsics probably will get lowered to a call to the runtime library.
1 parent 64296ac commit d0a4612

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/driver.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ const __llvm_initialized = Ref(false)
157157
if libraries
158158
runtime = load_runtime(job; ctx)
159159
runtime_fns = LLVM.name.(defs(runtime))
160+
runtime_intrinsics = ["julia.gc_alloc_obj"]
160161
end
161162

162163
@timeit_debug to "Library linking" begin
@@ -166,7 +167,7 @@ const __llvm_initialized = Ref(false)
166167
@timeit_debug to "target libraries" link_libraries!(job, ir, undefined_fns)
167168

168169
# GPU run-time library
169-
if any(fn -> fn in runtime_fns, undefined_fns)
170+
if any(fn -> fn in runtime_fns || fn in runtime_intrinsics, undefined_fns)
170171
@timeit_debug to "runtime library" link_library!(ir, runtime)
171172
end
172173
end

0 commit comments

Comments
 (0)