Page MenuHomePhabricator

[LoopSimplifyCFG] Remove phis whilst removing CFG edges

Authored by dmgreen on Nov 19 2018, 9:08 AM.



D54021 adds some extra folding of constant terminators to LoopSimplifyCFG. This fixes up
the phi nodes of successor blocks to those constant folded.

Diff Detail

Event Timeline

dmgreen created this revision.Nov 19 2018, 9:08 AM
dmgreen added inline comments.Nov 19 2018, 9:19 AM

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.

mkazantsev added inline comments.Nov 19 2018, 10:25 PM

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. :)

This thing is already fixed in a more general way in rL347289, I suggest to abandon this one. You can check in the test if you want, but we have similar tests in this patch.

dmgreen abandoned this revision.Nov 22 2018, 4:29 AM

Thanks for the fix!