Recompute the dominator tree on demand.

The legalizer can invalidate the dominator tree, but we don't actually
need a dominator tree during legalization, so defer the construction of
the domtree.

- Add an "invalid" state to the dominator tree along with clear() and
  is_valid() methods to test it.
- Invalidate the dominator tree as part of legalization.
- Ensure that a valid dominator tree exists before the passes that need
  it.

Together these features add up to a manual invalidation mechanism for
the dominator tree.
This commit is contained in:
Jakob Stoklund Olesen
2017-08-28 11:13:53 -07:00
parent fecbcbb7b4
commit 6d9198d55f
3 changed files with 34 additions and 5 deletions

View File

@@ -134,7 +134,9 @@ pub fn verify_context(func: &Function,
-> Result {
let verifier = Verifier::new(func, isa);
verifier.cfg_integrity(cfg)?;
verifier.domtree_integrity(domtree)?;
if domtree.is_valid() {
verifier.domtree_integrity(domtree)?;
}
verifier.run()
}