Skip to content

Commit 87444ea

Browse files
committed
Handle same offset in gc fixup
1 parent 135e843 commit 87444ea

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

src/llvm/transforms.jl

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,43 @@ function nodecayed_phis!(mod::LLVM.Module)
553553
if all_args
554554
continue
555555
end
556+
557+
all_args = true
558+
addrtodo = Value[inst]
559+
seen = Set{LLVM.Value}()
560+
561+
offset = nothing
562+
563+
while length(addrtodo) != 0
564+
v = pop!(addrtodo)
565+
base, toffset = get_base_and_offset(v)
566+
if offset === nothing
567+
offset = toffset
568+
else
569+
if offset != toffset
570+
all_args = false
571+
break
572+
end
573+
end
574+
if in(base, seen)
575+
continue
576+
end
577+
push!(seen, base)
578+
if isa(base, LLVM.Argument) && addrspace(value_type(base)) == 11
579+
continue
580+
end
581+
if isa(base, LLVM.PHIInst)
582+
for (v, _) in LLVM.incoming(base)
583+
push!(addrtodo, v)
584+
end
585+
continue
586+
end
587+
all_args = false
588+
break
589+
end
590+
if all_args
591+
continue
592+
end
556593
end
557594

558595
push!(todo, inst)

0 commit comments

Comments
 (0)