D54021 adds some extra folding of constant terminators to LoopSimplifyCFG. This fixes up
the phi nodes of successor blocks to those constant folded.
This can remove empty phi's I believe, which I'm not 100% sure about.
I think it's OK as-is but, Max, this may change with your followon patches. Feel free to commandeer if you think that's easier, otherwise let me know what you think.
Hi, I've done it in a bit more general way (using removePredecessor utility function) when re-enabled the patch after revert, see rL347289. The lack of Phis update caused crash on some lib compilation, it is now fixed and works.
Thanks for your effort, though. :)