This is an archive of the discontinued LLVM Phabricator instance.

[Dominators] Make slow walks shorter
ClosedPublic

Authored by kuhar on Jul 28 2018, 1:13 AM.

Details

Summary

When DFS numbers are not yet calculated for a dominator tree, we have to walk it up to say whether one node dominates some other.

This patch makes the slow walks shorter by only walking until the level of the node we check against is reached. This is because a node cannot possibly dominate something higher in its tree.

When running opt with -O3, the patch results in:

  • 25% fewer loop iterations for opt (fullLTO)
  • 30% fewer loop iterations for sqlite

Diff Detail

Repository
rL LLVM

Event Timeline

kuhar created this revision.Jul 28 2018, 1:13 AM
This revision is now accepted and ready to land.Jul 30 2018, 9:48 AM
This revision was automatically updated to reflect the committed changes.