[PATCH] D36963: Use sorting instead of a lot of stable_partitions for `ICF::segregate` function

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 23 13:51:10 PDT 2017


ruiu added a comment.

> less function treats all non-DefinedRegular relocations as equal, if they have the same Type and VirtualAddress. If we use the same function instead of equals, such COMDATS will be merged together. Are we allowed to do it?

I may be missing something, but why do we now have to handle relocations pointing to non-DefinedRegular symbols differently? I do not fully understand the new code, but such relocations have been handled correctly in the original code. As far as I understand this patch, this is purely a performance improvement change by using std::stable_sort instead of std::stable_partition, and I don't understand as to why a new issue wrt comparing two relocations arises with it.


https://reviews.llvm.org/D36963





More information about the llvm-commits mailing list