[PATCH] D125205: Replace the custom linked list in LeaderTableEntry with TinyPtrVector.

Owen Anderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 12 19:26:22 PDT 2022


resistor added a comment.

In D125205#3508443 <https://reviews.llvm.org/D125205#3508443>, @nikic wrote:

> It looks like this change ends up being a slightly negative in terms of instruction count: http://llvm-compile-time-tracker.com/compare.php?from=bf1b81d076f89bd56e86189b013f27dcf4d73ae8&to=efa882a79c027d27f6deff14e75bd9f558dd95d0&stat=instructions

As far as I can tell, the only behavioral difference with the new version is the order of leaders in the table, which biases the candidates returned by `findLeader`. The hand-rolled linked listed used an unprincipled ordering: the first candidate found was always at the front of the list, but after candidates were in reverse order of discovery. The new version is currently storing them strictly in order of recovery. I can try doing a backwards search in `findLeader`, which would be more similar to the the old approach on average. Really, we should probably have a more principled heuristic for choosing amongst the leaders, but that seems out of scope for this change.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D125205



More information about the llvm-commits mailing list