Skip to content

Commit

Permalink
Generalize to recursive argument-based decayed phi's (#1244)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Jan 24, 2024
1 parent 1b8732e commit ffb12e6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/compiler/optimize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,24 @@ function nodecayed_phis!(mod::LLVM.Module)
end
if addr == 11
all_args = true
for (v, _) in LLVM.incoming(inst)
addrtodo = Value[inst]

while length(addrtodo) != 0
v = pop!(addrtodo)
base = get_base_object(v)
seen = Set{LLVM.Value}()
if in(base, seen)
continue
end
push!(seen, base)
if isa(base, LLVM.Argument) && addrspace(value_type(base)) == 11
continue
end
if isa(v, LLVM.PHIInst)
for (v, _) in LLVM.incoming(inst)
push!(addrtodo, v)
end
end
all_args = false
break
end
Expand Down

0 comments on commit ffb12e6

Please sign in to comment.