[llvm] r296535 - Fix PR 24415 (at least), by making our post-dominator tree behavior sane.

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 15 08:45:30 PDT 2017


On Wed, Mar 15, 2017 at 8:35 AM, Daniel Berlin <dberlin at dberlin.org> wrote:

> See also, btw,
> https://arxiv.org/abs/1608.06462
> literally the first sentence of the abstract.
>
> A flow graph G=(V,E,s) is a directed graph with a distinguished start
> vertex s. The dominator tree D of G is a tree rooted at s, such that a
> vertex v is an ancestor of a vertex w if and only if all paths from s to w
> include v.
>
> Thus, it is legal, for example, to do the following with a dominator or
> post-dominator tree:
>
> for each dominator tree node:
>   Walk idoms back to virtual root (ignoring virtual root), put them in a
> set.
>   Get the associated CFG node A
>   for each thing in set:
>      perform depth_first_search starting at A in forward or backwards
> direction (for dom/post-dom)
>      assert that we find idom.
>
^^^^^^^^^^^
This should be assert that we find the child idoms that are in the set.

Another way to look at it:

Given a post-dom-tree

A
|
B
|
C
|
D


We should be able to depth first search the *CFG* from D to A and *every*
path we walk should contain C and B
We should be able to depth first search the *CFG* from C to A and *every*
path we walk should contain B.
We should be able to depth first search the *CFG* from D to B and *every*
path we walk should contain C.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170315/7d269e1b/attachment.html>


More information about the llvm-commits mailing list