Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/llvm-late-gc-lowering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ unsigned getCompositeNumElements(Type *T) {
// Walk through a Type, and record the element path to every tracked value inside
void TrackCompositeType(Type *T, std::vector<unsigned> &Idxs, std::vector<std::vector<unsigned>> &Numberings) {
if (isa<PointerType>(T)) {
if (T->getPointerAddressSpace() == AddressSpace::Tracked)
if (isSpecialPtr(T))
Numberings.push_back(Idxs);
}
else if (isa<StructType>(T) || isa<ArrayType>(T) || isa<VectorType>(T)) {
Expand Down
19 changes: 19 additions & 0 deletions test/llvmpasses/late-lower-gc.ll
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,25 @@ define {} addrspace(10)* @gclift_switch({} addrspace(13)* addrspace(10)* %input,
ret {} addrspace(10)* %ret
}

define void @decayar([2 x {} addrspace(10)* addrspace(11)*] %ar) {
%v2 = call {}*** @julia.get_pgcstack()
%e0 = extractvalue [2 x {} addrspace(10)* addrspace(11)*] %ar, 0
%l0 = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %e0
%e1 = extractvalue [2 x {} addrspace(10)* addrspace(11)*] %ar, 1
%l1 = load {} addrspace(10)*, {} addrspace(10)* addrspace(11)* %e1
%r = call i32 @callee_root({} addrspace(10)* %l0, {} addrspace(10)* %l1)
ret void
}

; CHECK-LABEL: @decayar
; CHECK: %gcframe = call {} addrspace(10)** @julia.new_gc_frame(i32 2)
; CHECK: %1 = call {} addrspace(10)** @julia.get_gc_frame_slot({} addrspace(10)** %gcframe, i32 1)
; CHECK: store {} addrspace(10)* %l0, {} addrspace(10)** %1, align 8
; CHECK: %2 = call {} addrspace(10)** @julia.get_gc_frame_slot({} addrspace(10)** %gcframe, i32 0)
; CHECK: store {} addrspace(10)* %l1, {} addrspace(10)** %2, align 8
; CHECK: %r = call i32 @callee_root({} addrspace(10)* %l0, {} addrspace(10)* %l1)
; CHECK: call void @julia.pop_gc_frame({} addrspace(10)** %gcframe)

!0 = !{i64 0, i64 23}
!1 = !{!1}
!2 = !{!7} ; scope list
Expand Down