When I get back to a sane computer I'll send a link to the paper<br><br><div class="gmail_quote"><div dir="ltr">On Sat, Oct 1, 2016, 9:40 AM David Callahan <<a href="mailto:dcallahan@fb.com">dcallahan@fb.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">david2050 added inline comments.<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
> dberlin wrote in ADCE.cpp:610<br class="gmail_msg">
> Is the above really necessary?<br class="gmail_msg">
><br class="gmail_msg">
> 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.<br class="gmail_msg">
> Replace all uses of the bb with that block using RAUW.<br class="gmail_msg">
> This should update phi nodes, since I believe the blocks in phi nodes are still considered uses.<br class="gmail_msg">
<br class="gmail_msg">
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.<br class="gmail_msg">
<br class="gmail_msg">
<a href="https://reviews.llvm.org/D24918" rel="noreferrer" class="gmail_msg" target="_blank">https://reviews.llvm.org/D24918</a><br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>