[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
Mon Mar 13 16:18:50 PDT 2017


BTW, note one further thing in your investigate.
Jikes, at least, would not handle this case.

It's a compile-time error in java to have unreachable code.
Additionally if i remember the JLS properly, the only statement that is
allowed to not return is "throw"
Otherwise, everything else generally is may-return, and so, should already
have the fake edges to exit anyway, they need them even outside the
post-dom tree.

there are detailed rules at the JLS spec 14.21:
http://docs.oracle.com/javase/specs/jls/se7/html/jls-14.html#jls-14.21

I would expect hotspot would be the same.



On Mon, Mar 13, 2017 at 12:43 PM, Daniel Berlin <dberlin at dberlin.org> wrote:

>
>>>> Most of the text above is just to give some background to others. I do
>>>> not expect you to answer in such detail. The only question I have if you
>>>> can give a specific example that would break with the alternative
>>>> solution I propose and which does not require strong post-dominance
>>>> (which is likely hard to guarantee)?
>>>>
>>> Yes.
>> ADCE breaks *right* now without the hack it has to try to work around
>> this (which is not correct in all cases, FWIW).
>> This is directly because of the path property. It also can break in some
>> cases because it's not sufficient to check just part of the path for the
>> discontinuity you introduce above.
>>
>> SSUPRE will break  because it relies on the path property to optimize
>> stores properly.
>> In fact, i'm pretty much not aware of a single optimization relying on
>> post-dom info that will not break. I'm also positive i can't work around it.
>>
>>
> 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 :)
>
> It relies on the path property for correctness of the computation.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170313/5350cd9d/attachment.html>


More information about the llvm-commits mailing list