[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
Tue Mar 14 09:02:35 PDT 2017


On Tue, Mar 14, 2017 at 8:57 AM, Daniel Berlin <dberlin at dberlin.org> wrote:

>
>
> On Tue, Mar 14, 2017 at 6:31 AM, Michael Kruse <llvm-commits at meinersbur.de
> > wrote:
>
>> 2017-03-13 20:43 GMT+01:00 Daniel Berlin via llvm-commits
>> <llvm-commits at lists.llvm.org>:
>> > As another analysis example, this will break the linear time reverse IDF
>> > calculation. It already does (and adce tries to work around that now),
>> but
>> > it will so even more :)
>>
>> How can that be?
>
>
> The linear time IDF calculation relies on the level numbering, which in
> turn, relies on the parent property.
>
>
>> All Tobias' suggestion does it adding a phantom edge.
>>
>
> Yes, as does mine.
>
>
>> The most number of edges it could add is the number of blocks.  If IDF
>> is linear, let's say in the number of edges, then this would just add
>> a constant per additional edge, or something linear in the number of
>> blocks.
>
>
> This is not the part that breaks.
> As mentioned, you can see *it already* breaks and ADCE is already trying
> to work around it.
>
> The part that breaks is that it assumes the level number is also
> representative of paths that can exist in the CFG when computing IDF.
> That is, the proof of correctness of stopping after processing a given
> level relies on the paths in the CFG vs the paths in the dominator tree.
> In Tobias's representation, this does not work, because he has broken the
> normal parent property of dominator trees.
>
> Imagine the following CFG;
>
>   a
>  /  \
> b   c
>      |
>     exit
>
> where b is a self-loop.
>
> The post-dom tree, in tobias's representation will be
>
>   virtual exit
>      |
>  exit
>      |
>     c
>    /  \
> b     a
>
>
and note, it actually doesn't matter what the exact representation  you
choose as an alternate:
Any representation where it does not connect a cycle member of b directly
to the virtual exit edge has the same issue - it will break the parent
property of the tree.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170314/a11ed2e9/attachment.html>


More information about the llvm-commits mailing list