Skip to content

Commit 9008a97

Browse files
committed
simplevector
1 parent 0aedc5c commit 9008a97

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/compiler.jl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1559,6 +1559,23 @@ function create_recursive_stores(B::LLVM.IRBuilder, @nospecialize(Ty::DataType),
15591559
nothing
15601560
end
15611561
else
1562+
if Ty == Core.SimpleVector
1563+
@assert count === nothing
1564+
@assert isa(prev, LLVM.CallInst)
1565+
@assert LLVM.name(LLVM.called_operand(prev)::LLVM.Function) == "julia.gc_alloc_obj"
1566+
sz = operands(prev)[2]
1567+
sz = sub!(B, sz, LLVM.ConstantInt(Int(sizeof(Ptr{Cvoid}))))
1568+
T_jlvalue = LLVM.StructType(LLVM.LLVMType[])
1569+
T_prjlvalue = LLVM.PointerType(T_jlvalue, Tracked)
1570+
prev = addrspacecast!(B, prev, LLVM.PointerType(T_jlvalue, Derived))
1571+
prev = bitcast!(B, prev, LLVM.PointerType(T_prjlvalue, Derived))
1572+
gep = LLVM.gep!(B, T_prjlvalue, prev, LLVM.Value[LLVM.ConstantInt(Int64(1))])
1573+
zeroAll = false
1574+
atomic = true
1575+
zero_allocation(B, Any, T_prjlvalue, prev, LLVM.ConstantInt(sizeof(Ptr{Cvoid})), sz, zeroAll, atomic)
1576+
return
1577+
end
1578+
15621579
if fieldcount(Ty) == 0
15631580
error("Error handling recursive stores for $Ty which has a fieldcount of 0")
15641581
end

0 commit comments

Comments
 (0)