[llvm] Split out DenseMapInfo<variant> specialization
authorElliot Goodrich <elliotgoodrich@gmail.com>
Thu, 22 Jun 2023 05:49:43 +0000 (06:49 +0100)
committerElliot Goodrich <elliotgoodrich@gmail.com>
Thu, 22 Jun 2023 05:50:54 +0000 (06:50 +0100)
commitcea0eea28e71204bf8543ca94dbf185cbf597ca5
tree471bac58f4173cd11b1df3437fdca2779a303a16
parent791c3cb7e6b43149349be2b0411ccb52d32ad087
[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
clang-tools-extra/include-cleaner/include/clang-include-cleaner/Types.h
flang/include/flang/Optimizer/HLFIR/HLFIROps.h
llvm/include/llvm/ADT/DenseMapInfo.h
llvm/include/llvm/ADT/DenseMapInfoVariant.h [new file with mode: 0644]
llvm/include/llvm/CodeGen/CallingConvLower.h
llvm/include/llvm/ExecutionEngine/Orc/LLJIT.h
llvm/include/llvm/Object/DXContainer.h
llvm/include/llvm/Transforms/Scalar/SROA.h
llvm/unittests/ADT/DenseMapTest.cpp
mlir/include/mlir/IR/AsmState.h
mlir/include/mlir/Transforms/SROA.h