Skip to content

Commit 7e7e280

Browse files
authored
reachability: Ignore virtual catch predecessor (#54077)
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.
1 parent c91edf3 commit 7e7e280

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

base/compiler/ssair/tarjan.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ function enqueue_if_unreachable!(reach::CFGReachability, cfg::CFG, bb::Int)
247247
# target is a reducible CFG node
248248
# this node lives iff it still has an incoming forward edge
249249
for pred in cfg.blocks[bb].preds
250+
# virtual edge does not count - if the enter is dead, that edge is
251+
# not taken.
252+
pred == 0 && continue
250253
!dominates(domtree, bb, pred) && return false # forward-edge
251254
end
252255
scc[bb] = 0

0 commit comments

Comments
 (0)