[PATCH] D28549: Global DCE performance improvement

Mehdi AMINI via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 11:14:57 PST 2017

mehdi_amini added a comment.

In https://reviews.llvm.org/D28549#648403, @davide wrote:

> This looks much better now. Can you please add a comment in the code explaining the algorithm (if I missed it, please point out) while I take a last look? Thanks.

To be fair: the algorithm isn't changed, it is just the "uses" graph edges that are reversed as a pre-step. 
I.e. the question is "how to you get all the globals referenced by another global"?

Before this patch, it was doing this by walking the body (or the initializer) and collecting the references.  What this patch is doing, it precomputing the answer to this query for the whole module by walking the use-list of every global instead.
I believe it is the only change.



More information about the llvm-commits mailing list