[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
Thu Aug 24 15:57:42 PDT 2017


ruiu added a comment.

I tried this patch locally again to self-link lld. Turned out that the output is not deterministic. For some reason, lld with this patch generates slightly different executable once in a while. There must be a logical bug in the code, but I don't know where it comes from. Can you take a look?



================
Comment at: lld/COFF/ICF.cpp:96
+  // Group equal chunks together and then split [Begin, End) range into smaller
+  // ranges with equal values
+  std::stable_sort(Chunks.begin() + Begin, Chunks.begin() + End, Less);
----------------
Put a full stop at the end of the sentence.


https://reviews.llvm.org/D36963





More information about the llvm-commits mailing list