Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
aviatesk committed Feb 9, 2022
1 parent 2a5f1eb commit 2ed12c5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/EscapeAnalysis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,14 @@ function inter_ainfo(AInfo::AInfo, estate::EscapeState)
if isa(x, LocalUse)
UseEscapeBits |= encode_escape_bits(estate[SSAValue(x.idx)])
elseif isa(x, InterUse)
UseEscapeBits |= x.EscapeBits
EscapeBits = x.EscapeBits
for v in x.aliases
info = estate[v]
if info !== nothing
EscapeBits |= encode_escape_bits(info)
end
end
UseEscapeBits |= EscapeBits
else
x = x::Definition
v = x.val
Expand Down Expand Up @@ -1117,6 +1124,8 @@ end
struct InterUse
idx::Int
EscapeBits::UInt8
aliases::IdSet{Any}
InterUse(idx::Int, EscapeBits::UInt8) = new(idx, EscapeBits, IdSet{Any}())
end

function add_alias_escapes!(astate::AnalysisState, @nospecialize(v), AInfo::AInfo)
Expand All @@ -1142,6 +1151,7 @@ function add_alias_escapes!(astate::AnalysisState, @nospecialize(v), AInfo::AInf
end
add_escape_change!(astate, v, interinfo)
end
push!(x.aliases, v)
else
@assert isa(x, Definition)
continue # ignore def
Expand Down

0 comments on commit 2ed12c5

Please sign in to comment.