[all-commits] [llvm/llvm-project] f0fa2d: [llvm] Move AttributeMask to a separate header

Elliot Goodrich via All-commits all-commits at lists.llvm.org
Tue Jun 27 07:29:54 PDT 2023


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

  Changed paths:
    M clang/lib/CodeGen/CGCall.cpp
    M clang/lib/CodeGen/CodeGenModule.cpp
    A llvm/include/llvm/IR/AttributeMask.h
    M llvm/include/llvm/IR/Attributes.h
    M llvm/lib/Analysis/BlockFrequencyInfoImpl.cpp
    M llvm/lib/Bitcode/Reader/BitcodeReader.cpp
    M llvm/lib/CodeGen/MLRegallocEvictAdvisor.cpp
    M llvm/lib/IR/Attributes.cpp
    M llvm/lib/IR/AutoUpgrade.cpp
    M llvm/lib/IR/Instruction.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/lib/Target/AMDGPU/AMDGPURewriteOutArguments.cpp
    M llvm/lib/Target/DirectX/DXILPrepare.cpp
    M llvm/lib/Transforms/IPO/DeadArgumentElimination.cpp
    M llvm/lib/Transforms/IPO/SCCP.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp
    M llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
    M llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
    M llvm/lib/Transforms/Utils/CallPromotionUtils.cpp
    M llvm/lib/Transforms/Utils/SimplifyLibCalls.cpp
    M llvm/tools/llvm-reduce/deltas/ReduceInstructions.cpp
    M llvm/unittests/IR/AttributesTest.cpp

  Log Message:
  -----------
  [llvm] Move AttributeMask to a separate header

Move `AttributeMask` out of `llvm/IR/Attributes.h` to a new file
`llvm/IR/AttributeMask.h`.  After doing this we can remove the
`#include <bitset>` and `#include <set>` directives from `Attributes.h`.
Since there are many headers including `Attributes.h`, but not needing
the definition of `AttributeMask`, this causes unnecessary bloating of
the translation units and slows down compilation.

This commit adds in the include directive for `llvm/IR/AttributeMask.h`
to the handful of source files that need to see the definition.

This reduces the total number of preprocessing tokens across the LLVM
source files in lib from (roughly) 1,917,509,187 to 1,902,982,273 - a
reduction of ~0.76%. This should result in a small improvement in
compilation time.

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




More information about the All-commits mailing list