Updating the MachineDominatorTree is easy since SILowerControlFlow only
splits and removes basic blocks. This should save a bit of compile time
because previously we would recompute the dominator tree from scratch
after this pass.
Another reason for doing this is that SILowerControlFlow preserves
LiveIntervals which transitively requires MachineDominatorTree. I think
that means that SILowerControlFlow is obliged to preserve
MachineDominatorTree too as explained here:
https://lists.llvm.org/pipermail/llvm-dev/2020-November/146923.html
although it does not seem to have caused any problems in practice yet.
Incidentally, AMDGPU has a few passes that split MBBs, and they all have their own code to update dominators. It would be good to common this up. I also wonder if splitting an MBB should create a new MBB for the first half of the split, not the second half, because that would make the dominator update more efficient and trivially supported by MachineDominatorTree::splitBlock.