In some cases the order that we hoist instructions in means that when rehoisting (which uses the same order as hoisting) we can rehoist to a block A, then a block B, then block A again. This currently causes an assertion failure as it expects that when changing the hoist point it only ever moves to a block that dominates the hoist point being moved from.
Fix this by having per-block hoist points, which means we can do away with the assertion.
If we replace HoistPoint->getParent() != Dominator with DT->dominates(Dominator, HoistPoint->getParent()), will it solve your problem?