There exists a corner-case for function TryToSimplifyUncondBranchFromEmptyBlock() in Local.cpp where it's posible to
pass:
DT->insertEdge(BB, BB);
to the dominator tree subsystem. When this happens the DT code (correctly) asserts since a block cannot dominate itself.
The error was discovered when inspecting the code for D37528 .