[PATCH] D38097: [IVUsers] Changes to make IVUsers's results robust to instruction and uselist ordering

Daniel Neilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 09:25:26 PDT 2017


dneilson added a comment.

In https://reviews.llvm.org/D38097#878856, @dberlin wrote:

> So, TL;DR, i'm not sure how much you really care, this isn't going to make your ordering completely consistent in the face of use list reordering or instruction ordering. It should work if there is a single cycle, but not if there are nested cycles.
>
> Is there a reason not to use a complete solution, which would be "form sccs of ssa graph, sort them if necessary, perform whatever filtering you want".
>
> Forming scc's guarantees you have all instructions that you could ever want to process.
>  You can then sort the SCC's by dominance order (DT dfs numbers, then local dfs numbers) if you don't like the ordering it produces, and process.
>
> That will guarantee completely consistent ordering, as tarjan scc's are maximal.
>
> (This will have the same time bound as the current DFS based solution)


No reason other than "didn't think of it" -- my first stab at this is trying to retain as much of the existing code/behaviour as possible.

Can you point me to another pass that uses the technique that you suggest? I'd like to see a sample of how it's implemented & how it works.


https://reviews.llvm.org/D38097





More information about the llvm-commits mailing list