Skip to content

Commit 0a22a88

Browse files
committed
Don't add arguments to jlcall calls.
1 parent f08aeb3 commit 0a22a88

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/irgen.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,17 @@ function add_kernel_state!(@nospecialize(job::CompilerJob), mod::LLVM.Module,
678678
for use in uses(f)
679679
val = user(use)
680680
if val isa LLVM.CallBase && called_value(val) == f
681+
# NOTE: we don't rewrite calls using Julia's jlcall calling convention,
682+
# as those have a fixed argument list, passing actual arguments
683+
# in an array of objects. that doesn't matter, for now, since
684+
# GPU back-ends don't support such calls anyhow. but if we ever
685+
# want to support kernel state passing on more capable back-ends,
686+
# we'll need to update the argument array instead.
687+
if callconv(val) == 37 || callconv(val) == 38
688+
# TODO: update for LLVM 15 when JuliaLang/julia#45088 is merged.
689+
continue
690+
end
691+
681692
# forward the state argument
682693
position!(builder, val)
683694
state = call!(builder, state_intr, Value[], "state")

0 commit comments

Comments
 (0)