Skip to content

Commit 37602e9

Browse files
committed
fix
1 parent 9c162cb commit 37602e9

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

src/compiler.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,11 +1065,11 @@ end
10651065
return
10661066
end
10671067

1068-
function set_module_types!(interp, mod::LLVM.Module, primalf::Union{Nothing, LLVM.Function}, job, edges, run_enzyme, mode::API.CDerivativeMode)
1068+
function set_module_types!(interp, mod::LLVM.Module, primalf::Union{Nothing, LLVM.Function}, job, edges, run_enzyme, mode::API.CDerivativeMode)::Tuple{Dict{String,LLVM.API.LLVMLinkage}, HandlerState}
10691069

10701070
for f in functions(mod)
10711071
if startswith(LLVM.name(f), "japi3") || startswith(LLVM.name(f), "japi1")
1072-
return
1072+
continue
10731073
end
10741074
mi, RT = enzyme_custom_extract_mi(f, false)
10751075
if mi === nothing

src/jlrt.jl

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,6 @@ function get_memory_len(B::LLVM.IRBuilder, @nospecialize(array::LLVM.Value))
961961
"ijl_alloc_genericmemory",
962962
)
963963
res = operands(array)[2]
964-
for i = 2:num
965-
res = mul!(B, res, operands(array)[1+i])
966-
end
967964
return res
968965
end
969966
if nm in (
@@ -1004,11 +1001,11 @@ function get_memory_nbytes(B::LLVM.IRBuilder, memty::Type{<:Memory}, nel::LLVM.V
10041001
if isboxed
10051002
elsz = LLVM.ConstantInt(sizeof(Ptr{Cvoid}))
10061003
end
1007-
nbytes = LLVM.mul!(b, nel, elsz)
1004+
nbytes = LLVM.mul!(B, nel, elsz)
10081005

10091006
if isunion
10101007
# an extra byte for each isbits union memory element, stored at m->ptr + m->length
1011-
nbytes = LLVM.add!(b, nbytes, nel)
1008+
nbytes = LLVM.add!(B, nbytes, nel)
10121009
end
10131010
return nbytes
10141011
end
@@ -1031,7 +1028,7 @@ function get_memory_nbytes(B::LLVM.IRBuilder, @nospecialize(array::LLVM.Value))
10311028
end
10321029
end
10331030
nel = get_memory_len(B, array)
1034-
legal, JTy = abs_typeof(ty)
1031+
legal, memty = abs_typeof(array)
10351032
@assert legal
10361033
return get_memory_nbytes(B, memty, nel)
10371034
end

0 commit comments

Comments
 (0)