[PATCH] D24918: [ADCE] Add code to remove dead branches

Daniel Berlin via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 1 09:22:51 PDT 2016


When I get back to a sane computer I'll send a link to the paper

On Sat, Oct 1, 2016, 9:40 AM David Callahan <dcallahan at fb.com> wrote:

> david2050 added inline comments.
>
>
> > dberlin wrote in ADCE.cpp:610
> > Is the above really necessary?
> >
> > The standard way to do this, AFAIK, is to mark the useful block set
> while doing marking, and then just walking up the PDT to find the nearest
> block marked useful for each dead branch.
> > Replace all uses of the bb with that block using RAUW.
> > This should update phi nodes, since I believe the blocks in phi nodes
> are still considered uses.
>
> I don't understand this approach. Given a live branch  (x,y) where y is
> dead and  z is the live post-dominator of y, we can't just replace uses of
> 'y' because the 'y' may not be directly referenced in phi nodes in 'z'
> which only will old references to its predecessors. Also, 'y' could have
> multiple branches into it which are dead.
>
> https://reviews.llvm.org/D24918
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161001/313676c4/attachment.html>


More information about the llvm-commits mailing list