When we show that our stop block is not dominated by the current block, we don't need to visit any of the other dominated blocks except to visit their successors. Efficiently add those transitive successors to the worklist.
When both a dominator tree is available and we're in a loop, prefer to jump to the exit blocks of a loop. We could fuse the two by visiting only the non-dominated transitive successors of the loop, but it would have the same effect as simply adding the loop blocks to the worklist and going through the check again. I don't think the savings of redundant checks is worth the complexity, at worst we might have one extra call to DomTree::dominates per loop exit block.
In one sense there's no functionality change here, but isPotentiallyReachable now does more work per loop iteration which means that it may complete successfully instead of running into the block limit and giving up.