Skip to content

Commit

Permalink
Fix indexing error in TwoPhaseDefUseMap (#50280)
Browse files Browse the repository at this point in the history
There was an off-by-one in the indexing for TwoPhaseDefUseMap, causing
def-use chains to not be properly visited. We don't use this functionality
much in base, because it's only active for irinterp on functions with
loops that were shown to terminate, which the compiler currently does
not generally have the power to do, but I saw it in some downstream
experiments.
  • Loading branch information
Keno committed Jun 25, 2023
1 parent dd1f03d commit 39a4013
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion base/compiler/inferencestate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,9 @@ function kill_def_use!(tpdum::TwoPhaseDefUseMap, def::Int, use::Int)
ndata = tpdum.data[idx+1]
ndata == 0 && break
tpdum.data[idx] = ndata
idx += 1
end
tpdum.data[idx + 1] = 0
tpdum.data[idx] = 0
end
end
kill_def_use!(tpdum::TwoPhaseDefUseMap, def::SSAValue, use::Int) =
Expand Down

0 comments on commit 39a4013

Please sign in to comment.