[PATCH] D45519: [ELF] - Change the way of sorting local symbols.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 12 01:52:19 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D45519#1065055, @ruiu wrote:

> > Since the order of two files is arbitrary, how about just giving each InputFile a number when it is created ?
>
> That's exactly what I was thinking. :) I'll send you guys a patch.


That will not work. First what I tried was: I changed the predicate from return `FileIDs[L.Sym->File] < FileIDs[R.Sym->File];` to `return L.Sym->File < R.Sym->File;` (just to look how the lookup in the hash table affects the perfomance).
It decreased CPU time by about 1%, but it still was about 2%. After that this patch born.


https://reviews.llvm.org/D45519





More information about the llvm-commits mailing list