[PATCH] D28549: Global DCE performance improvement

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 17 11:30:26 PST 2017

davide added a comment.

In https://reviews.llvm.org/D28549#648456, @mehdi_amini wrote:

> 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.

That should go in a comment, this is my point.



More information about the llvm-commits mailing list