[PATCH] D36963: Use sorting instead of a lot of stable_partitions for `ICF::segregate` function
Alex Telishev via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 23 09:57:50 PDT 2017
alex.telishev added inline comments.
================
Comment at: lld/COFF/ICF.cpp:112
+ for (size_t Pos = Begin + 1; Pos < End; Pos++) {
+ if (Equal(Chunks[GroupBegin], Chunks[Pos]))
+ continue;
----------------
ruiu wrote:
> alex.telishev wrote:
> > ruiu wrote:
> > > I believe you can use Less instead of Equal and remove equals{Constant,Variables} functions. What am I missing?
> > We changed `Less{Constant,Variables}` functions so now every non-`DefinedRegular` relocations are equal to each other. As the result they will all receive the same Class if we use `Less` function in the loop.
> Can you make a change to `less` functions so that you can remove `equals` functions somehow?
`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?
https://reviews.llvm.org/D36963
More information about the llvm-commits
mailing list