[llvm] f0d05b9 - [NFC][DebugInfo] Make MDNodeKeyImpl<DILocation>::Column 16 bits (#143399)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 10 00:33:16 PDT 2025


Author: Orlando Cazalet-Hyams
Date: 2025-06-10T08:33:13+01:00
New Revision: f0d05b973b0d09521aad00d3aec36e4478626cc2

URL: https://github.com/llvm/llvm-project/commit/f0d05b973b0d09521aad00d3aec36e4478626cc2
DIFF: https://github.com/llvm/llvm-project/commit/f0d05b973b0d09521aad00d3aec36e4478626cc2.diff

LOG: [NFC][DebugInfo] Make MDNodeKeyImpl<DILocation>::Column 16 bits (#143399)

Column is limited to 16 bits in several places in the compiler:
DebugInfoMetadata.cpp#L87, LLParser.cpp#L4706, and more

Slight compile time improvement due to reducing `hash_combine` workload
in `MDNodeKeyImpl<DILocation>::getHashValue()`.

Positively affects compile time regardless of whether Key Instructions
is enabled. See PR for numbers.

Added: 
    

Modified: 
    llvm/lib/IR/LLVMContextImpl.h

Removed: 
    


################################################################################
diff  --git a/llvm/lib/IR/LLVMContextImpl.h b/llvm/lib/IR/LLVMContextImpl.h
index 7b6083a7a3496..87cd52e357be2 100644
--- a/llvm/lib/IR/LLVMContextImpl.h
+++ b/llvm/lib/IR/LLVMContextImpl.h
@@ -311,7 +311,7 @@ template <> struct MDNodeKeyImpl<MDTuple> : MDNodeOpsKey {
 /// DenseMapInfo for DILocation.
 template <> struct MDNodeKeyImpl<DILocation> {
   unsigned Line;
-  unsigned Column;
+  uint16_t Column;
   Metadata *Scope;
   Metadata *InlinedAt;
   bool ImplicitCode;
@@ -320,7 +320,7 @@ template <> struct MDNodeKeyImpl<DILocation> {
   uint64_t AtomRank : 3;
 #endif
 
-  MDNodeKeyImpl(unsigned Line, unsigned Column, Metadata *Scope,
+  MDNodeKeyImpl(unsigned Line, uint16_t Column, Metadata *Scope,
                 Metadata *InlinedAt, bool ImplicitCode, uint64_t AtomGroup,
                 uint8_t AtomRank)
       : Line(Line), Column(Column), Scope(Scope), InlinedAt(InlinedAt),


        


More information about the llvm-commits mailing list