The current ad-hoc implementation used to determine whether a basic block is unreachable doesn't work correctly in the general case (for example it won't detect successors of unreachable blocks as unreachable). This patch replaces it with the correct API that uses a DominatorTree to answer the question correctly and quickly.
rdar://77181156
It looks like UnreachableCache doesn't be used.