[PATCH] D153728: [llvm] Move AttributeMask to a separate header

Elliot Goodrich via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sun Jun 25 14:30:31 PDT 2023


IncludeGuardian created this revision.
IncludeGuardian added a reviewer: aaron.ballman.
Herald added subscribers: mtrofin, Enna1, ormris, foad, jdoerfert, kerbowa, hiraditya, jvesely, arsenm, qcolombet, MatzeB.
Herald added a project: All.
IncludeGuardian requested review of this revision.
Herald added projects: clang, LLVM.
Herald added subscribers: llvm-commits, cfe-commits.

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.

Additionally, the `llvm/ADT/SmallString.h` include directive was not
needed and has been removed.

This commit adds 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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D153728

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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D153728.534374.patch
Type: text/x-patch
Size: 15737 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230625/d60fb007/attachment-0001.bin>


More information about the cfe-commits mailing list