[llvm-commits] patch: smarter DSE

Owen Anderson resistor at mac.com
Thu Nov 3 11:15:02 PDT 2011


On Oct 31, 2011, at 11:22 AM, Nick Lewycky wrote:

> On 31 October 2011 10:23, Owen Anderson <resistor at mac.com> wrote:
> Nick,
> 
> Isn't what you're computing here an approximation of immediate post-dominance?  If we really want to handle this properly, it seems like we should just use the actual post-dominance computation rather than approximating it.
> 
> Heh, an earlier version of my patch actually called that function FindPostIdoms.
> 
> No, simply looking at postdoms would actually do the wrong thing. Consider a CFG "A -> {B, C}, B -> D, C -> D": the matching postdom tree is "D -> {A, B, C}". Given a free in block D we would look for and delete stores in A. Trouble is, those aren't necessarily dead as there may be uses in B and C. That's why I explicitly check through the preds.

OK, I see your point there.  I guess this is another case where we want to have reverse MemDep.

I'm fine with this going in, but please check for compile-time regressions first.  Inter-block DSE has been a source of regressions in the past.

--Owen

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111103/217584b4/attachment.html>


More information about the llvm-commits mailing list