This patch makes LoopDeletion use the incremental DominatorTree API.
We modify LoopDeletion to perform the deletion in 5 steps:
- Create a new dummy edge from the preheader to the exit, by adding a conditional branch.
- Inform the DomTree about the new edge.
- Remove the conditional branch and replace it with an unconditional edge to the exit. This removes the edge to the loop header, making it unreachable.
- Inform the DomTree about the deleted edge.
- Remove the unreachable block from the function.
Creating the dummy conditional branch is necessary to perform incremental DomTree update.
We should consider using the batch updater when it's ready.
That looks good to me.