[PATCH] D46422: [LCSSA] Iteratively remove unused PHI nodes in formLCSSAForInstructions

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 7 08:26:03 PDT 2018


bjope added a comment.

In https://reviews.llvm.org/D46422#1088776, @dberlin wrote:

> A few notes:
>
> 1. Because there is no single root here reaching all nodes, you can't guarantee the ordering will give a single iteration order for any sort order of the list.
> 2. We are assuming no cycles (you could find sccs here to deal with the cycles, it's the same cost as finding RPO because they are done the same way)
> 3. Off the top of my head, my intuition is that if the list is in dominator tree order (which is an RPO except for siblings) to start, the RPO generated by DFS of the operand tree should avoid the problem mentioned in 1, because it would initially order it the same way it would be ordered in the presence of a single root.


Thanks!
And yes, my solution did not handle/assume cycles (nor did the old solution). I was assuming that the problem only were related to later added PHI nodes using the value from an earlier added PHI node when I originally uploaded this patch.


Repository:
  rL LLVM

https://reviews.llvm.org/D46422





More information about the llvm-commits mailing list