[PATCH] D103113: [lld-macho] Deduplicate fixed-width literals

Thorsten via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed May 26 07:44:13 PDT 2021


tschuett added a comment.

This does not compile:

  std::vector<String<4>> strings4;
  strings4.reserve(number_of_4_strings*sizeof(String<4>));
  for (size_t i = 0, e = isec->data.size() / 4; i < e; ++i) {
    strings4.emplace_back(String<4>(xxx));
  }
  strings4.sort();
  auto bla = std::unique(strings4.begin(), strings4.end());

The hash map will have a lot of mallocs. I would expect sort + unique to be faster. Maybe even parallel sort.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103113/new/

https://reviews.llvm.org/D103113



More information about the llvm-commits mailing list