[PATCH] D45325: [ELF] - Reorder local symbols.

George Rimar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 10 02:05:11 PDT 2018


grimar added a comment.

In https://reviews.llvm.org/D45325#1062289, @espindola wrote:

> In https://reviews.llvm.org/D45325#1062280, @ruiu wrote:
>
> > > Also, could we merge the partition and the sort?
> >
> > I thought the same thing, but I guess separating partition and sort is faster than merging them into one sort function call. Partition is O(n) and sort is O(n log n). So, IIUC, partitioning into local and global symbols first and then sorting only the local part should be faster than sorting the entire vector.
>
>
> Sounds good. Lets keep both for now.


And it also makes final code simpler IMO. We need to set `Info` to the number of locals and it is simple to do with partitioning.


https://reviews.llvm.org/D45325





More information about the llvm-commits mailing list