[all-commits] [llvm/llvm-project] cea0ee: [llvm] Split out DenseMapInfo<variant> specialization

Elliot Goodrich via All-commits all-commits at lists.llvm.org
Wed Jun 21 22:52:29 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: cea0eea28e71204bf8543ca94dbf185cbf597ca5
      https://github.com/llvm/llvm-project/commit/cea0eea28e71204bf8543ca94dbf185cbf597ca5
  Author: Elliot Goodrich <elliotgoodrich at gmail.com>
  Date:   2023-06-22 (Thu, 22 Jun 2023)

  Changed paths:
    M clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h
    M flang/include/flang/Optimizer/HLFIR/HLFIROps.h
    M llvm/include/llvm/ADT/DenseMapInfo.h
    A llvm/include/llvm/ADT/DenseMapInfoVariant.h
    M llvm/include/llvm/CodeGen/CallingConvLower.h
    M llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
    M llvm/include/llvm/Object/DXContainer.h
    M llvm/include/llvm/Transforms/Scalar/SROA.h
    M llvm/unittests/ADT/DenseMapTest.cpp
    M mlir/include/mlir/IR/AsmState.h
    M mlir/include/mlir/Transforms/SROA.h

  Log Message:
  -----------
  [llvm] Split out DenseMapInfo<variant> specialization

Remove the `DenseMapInfo<std::variant<Ts...>>` variant out from
`llvm/ADT/DenseMapInfo.h` into a separate header
`llvm/ADT/DenseMapInfoVariant.h`

This allows us to remove the `<variant>` include, which is being
transitively and unncessary included in all translation units that
include `llvm/ADT/DenseMap.h`.

There have been similar changes to move out specializations for

    * `APInt.h` fd7e309e02fd226b0390888388ed732608e52c73 and
    * `StringRef.h`/`ArrayRef.h`
      983565a6fe4a9f40c7caf82b65c650c20dbcc104

to reduce the compilation time. As we are unable to move the
specialization into `<variant>`, we create a separate
`DenseMapInfoVariant.h` header that can be used by anyone who needs this
specialization.

This reduces the total number of preprocessing tokens across the LLVM
source files in lib from (roughly) 1,964,876,961 to 1,936,551,496 - a
reduction of ~1.44%. This should result in a small improvement in
compilation time.

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




More information about the All-commits mailing list