llvm-project/mlir/lib/Target/LLVMIR/Dialect
serge-sans-paille ffe8720aa0 Reduce dependencies on llvm/BinaryFormat/Dwarf.h
This header is very large (3M Lines once expended) and was included in location
where dwarf-specific information were not needed.

More specifically, this commit suppresses the dependencies on
llvm/BinaryFormat/Dwarf.h in two headers: llvm/IR/IRBuilder.h and
llvm/IR/DebugInfoMetadata.h. As these headers (esp. the former) are widely used,
this has a decent impact on number of preprocessed lines generated during
compilation of LLVM, as showcased below.

This is achieved by moving some definitions back to the .cpp file, no
performance impact implied[0].

As a consequence of that patch, downstream user may need to manually some extra
files:

llvm/IR/IRBuilder.h no longer includes llvm/BinaryFormat/Dwarf.h
llvm/IR/DebugInfoMetadata.h no longer includes llvm/BinaryFormat/Dwarf.h

In some situations, codes maybe relying on the fact that
llvm/BinaryFormat/Dwarf.h was including llvm/ADT/Triple.h, this hidden
dependency now needs to be explicit.

$ clang++ -E  -Iinclude -I../llvm/include ../llvm/lib/Transforms/Scalar/*.cpp -std=c++14 -fno-rtti -fno-exceptions | wc -l
after:   10978519
before:  11245451

Related Discourse thread: https://llvm.discourse.group/t/include-what-you-use-include-cleanup
[0] https://llvm-compile-time-tracker.com/compare.php?from=fa7145dfbf94cb93b1c3e610582c495cb806569b&to=995d3e326ee1d9489145e20762c65465a9caeab4&stat=instructions

Differential Revision: https://reviews.llvm.org/D118781
2022-02-04 11:44:03 +01:00
..
AMX Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
ArmNeon Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
ArmSVE Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
LLVMIR [mlir][LLVM] Add support for operand_attrs to InlineAsmOp 2022-02-01 05:56:14 -05:00
NVVM Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
OpenACC Reapply "[OpenMP][NFCI] Embed the source location string size in the ident_t" 2021-12-29 01:10:38 -06:00
OpenMP Reduce dependencies on llvm/BinaryFormat/Dwarf.h 2022-02-04 11:44:03 +01:00
ROCDL Fix clang-tidy issues in mlir/ (NFC) 2021-12-20 20:25:01 +00:00
X86Vector Adjust "end namespace" comment in MLIR to match new agree'd coding style 2021-12-08 06:05:26 +00:00
CMakeLists.txt [mlir][openacc] Add OpenACC translation to LLVM IR (enter_data op create/copyin) 2021-05-12 13:41:14 -04:00