The Cooper-Harvey-Kennedy dominance algorithm you are implementing is literally the one in LLVM's source (DominatorTree), chosen because it beats the asymptotically-better Lengauer-Tarjan in practice. Dominators gate everything: SSA construction, loop identification, and code motion are all defined in terms of them.