This is an archive of the discontinued LLVM Phabricator instance.

[Dominators] Improve error checking in deleteEdge
ClosedPublic

Authored by kuhar on Jul 18 2017, 10:37 AM.

Details

Summary

This patch improves error detection in deleteEdge. It asserts that the edge doesn't exist in the CFG and that DomTree knew about this edge before.

Diff Detail

Event Timeline

kuhar created this revision.Jul 18 2017, 10:37 AM
kuhar updated this revision to Diff 107141.Jul 18 2017, 11:22 AM

Only run the check in debug configuration.

dberlin accepted this revision.Jul 18 2017, 11:24 AM
This revision is now accepted and ready to land.Jul 18 2017, 11:24 AM
grosser edited edge metadata.Jul 18 2017, 11:25 AM

Can you maybe document that splitEdge is supposed to only be called on nodes that are part of the dominator tree.

Also, what about blocks that are unreachable form the entry and not part of the dominator tree?

kuhar added a comment.Jul 18 2017, 1:11 PM

@grosser: (I think that you meant to send that in the other review)
Updates to unreachable regions (IE nodes not in the DT) are essentially NOPs, so the logic should also work in that case.

This revision was automatically updated to reflect the committed changes.