Skip to content

Commit

Permalink
Handle same offset in gc fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses committed Jan 4, 2025
1 parent 135e843 commit 87444ea
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions src/llvm/transforms.jl
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,43 @@ function nodecayed_phis!(mod::LLVM.Module)
if all_args
continue
end

all_args = true
addrtodo = Value[inst]
seen = Set{LLVM.Value}()

offset = nothing

while length(addrtodo) != 0
v = pop!(addrtodo)
base, toffset = get_base_and_offset(v)
if offset === nothing
offset = toffset
else
if offset != toffset
all_args = false
break
end
end
if in(base, seen)
continue
end
push!(seen, base)
if isa(base, LLVM.Argument) && addrspace(value_type(base)) == 11
continue
end
if isa(base, LLVM.PHIInst)
for (v, _) in LLVM.incoming(base)
push!(addrtodo, v)
end
continue
end
all_args = false
break
end
if all_args
continue
end
end

push!(todo, inst)
Expand Down

0 comments on commit 87444ea

Please sign in to comment.