Skip to content

Commit

Permalink
reachability: Ignore virtual catch predecessor (#54077)
Browse files Browse the repository at this point in the history
For catch blocks, we add a virtual `0` predecessor in addition to the
predecessor from the enter block. However, for reachability purposes,
only real predecessors count, so ignore that here.
  • Loading branch information
Keno authored Apr 14, 2024
1 parent c91edf3 commit 7e7e280
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions base/compiler/ssair/tarjan.jl
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ function enqueue_if_unreachable!(reach::CFGReachability, cfg::CFG, bb::Int)
# target is a reducible CFG node
# this node lives iff it still has an incoming forward edge
for pred in cfg.blocks[bb].preds
# virtual edge does not count - if the enter is dead, that edge is
# not taken.
pred == 0 && continue
!dominates(domtree, bb, pred) && return false # forward-edge
end
scc[bb] = 0
Expand Down

0 comments on commit 7e7e280

Please sign in to comment.