[PATCH] D28594: NewGVN: Move leaders around properly to ensure we have a canonical dominating leader. Fixes PR 31613.

Daniel Berlin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 12 09:12:26 PST 2017


dberlin added a comment.

In https://reviews.llvm.org/D28594#643719, @davide wrote:

> Some comments inline, this looks correct but I'd like to run some tests tomorrow morning once I'm back to my workstation. Quick question, I can see how a set/vector can help here but I didn't think about the fib heap. Why did you mention such a variant and not let's say binomial/trinomial?


Fibheaps have O(1) insert/delete. We don't want to pay any cost until we actually extract.   So when we add/remove members, we just do that, and then when we actually change leaders, we pay the cost of extracting the min.
You could also use weak rank heaps.

(Note that delete on a fibheap/rank paired heap is basically tombstoning by just "decrease-key to negative infinity", special case them on extract/etc)


https://reviews.llvm.org/D28594





More information about the llvm-commits mailing list