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

Owen Anderson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun May 8 22:38:49 PDT 2022


resistor created this revision.
Herald added a subscriber: hiraditya.
Herald added a project: All.
resistor requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

The purpose of the custom linked list was to optimize for the case
of a single-element list. It turns out that TinyPtrVector handles
the same basic scenario even better, reducing the size of
LeaderTableEntry by 33%, and requiring only log2(N) allocations
as the size of the list grows. The only downside is that we have
to store the Value's and BasicBlock's in separate vectors, which
is slightly awkward in a few cases. Fortunately that ends up being
entirely encapsulated inside helper functions.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D125205

Files:
  llvm/include/llvm/Transforms/Scalar/GVN.h
  llvm/lib/Transforms/Scalar/GVN.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D125205.427978.patch
Type: text/x-patch
Size: 5732 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220509/f5e46ddd/attachment.bin>


More information about the llvm-commits mailing list