[PATCH] D33587: [DAGCombine] Do several rounds of combine.

Nirav Dave via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 1 20:23:56 PDT 2017


niravd added a comment.

It sounds like the underlying cause of this is related to the conversation on diamond nodes you started on llvm-dev. Reading your description I think I understnad the issue more and I believe have a solution that should fix the underlying issue without needing to loop on all nodes multiple times.

The problem with optimizations on a deeper DAG optimizations is that we cannot leverage the fact that we add both changed/new nodes and their users to guarantee that we consider the key node (i.e. the one that triggers the optimization). You can work around this by checking for the optimization from all nodes you match on. This will increase the number of times you check, but much less than revisiting all nodes. You should be able to avoid doing the check off of each node you match against, and only check alternating layers (which might let you only have to do the optimization check for the fork and join points in a diamond shape).


https://reviews.llvm.org/D33587





More information about the llvm-commits mailing list