diff --git a/src/irgen.jl b/src/irgen.jl index 971ba64e..ca3f21cf 100644 --- a/src/irgen.jl +++ b/src/irgen.jl @@ -343,7 +343,6 @@ end # https://reviews.llvm.org/D79744 function lower_byval(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.Function) ft = function_type(f) - @compiler_assert return_type(ft) == LLVM.VoidType() job @timeit_debug to "lower byval" begin # find the byval parameters diff --git a/src/metal.jl b/src/metal.jl index 1dd942ce..43db3db3 100644 --- a/src/metal.jl +++ b/src/metal.jl @@ -356,7 +356,6 @@ end # Metal doesn't support passing valuse, so we need to convert those to references instead function pass_by_reference!(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.Function) ft = function_type(f) - @compiler_assert return_type(ft) == LLVM.VoidType() job # generate the new function type & definition args = classify_arguments(job, ft) diff --git a/src/spirv.jl b/src/spirv.jl index 0ba30dae..14883bb8 100644 --- a/src/spirv.jl +++ b/src/spirv.jl @@ -220,7 +220,6 @@ end # wrap byval pointers in a single-value struct function wrap_byval(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.Function) ft = function_type(f)::LLVM.FunctionType - @compiler_assert return_type(ft) == LLVM.VoidType() job # find the byval parameters byval = BitVector(undef, length(parameters(ft))) @@ -253,7 +252,7 @@ function wrap_byval(@nospecialize(job::CompilerJob), mod::LLVM.Module, f::LLVM.F end push!(new_types, typ) end - new_ft = LLVM.FunctionType(LLVM.VoidType(), new_types) + new_ft = LLVM.FunctionType(return_type(ft), new_types) new_f = LLVM.Function(mod, "", new_ft) linkage!(new_f, linkage(f)) for (arg, new_arg) in zip(parameters(f), parameters(new_f))