[all-commits] [llvm/llvm-project] 1e9114: Replace the custom linked list in LeaderTableEntry...

Owen Anderson via All-commits all-commits at lists.llvm.org
Wed May 25 23:52:57 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1e9114984490b83d4665f12a11f84c83f50ca8f0
      https://github.com/llvm/llvm-project/commit/1e9114984490b83d4665f12a11f84c83f50ca8f0
  Author: Owen Anderson <resistor at mac.com>
  Date:   2022-05-25 (Wed, 25 May 2022)

  Changed paths:
    M llvm/include/llvm/Transforms/Scalar/GVN.h
    M llvm/lib/Transforms/Scalar/GVN.cpp

  Log Message:
  -----------
  Replace the custom linked list in LeaderTableEntry with TinyPtrVector.

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.

Reviewed By: asbirlea

Differential Revision: https://reviews.llvm.org/D125205




More information about the All-commits mailing list