[all-commits] [llvm/llvm-project] 2bddab: DebugInfo: Don't hash DIE offsets before they're c...

David Blaikie via All-commits all-commits at lists.llvm.org
Sat Dec 25 16:09:49 PST 2021

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2bddab25dba8d4b0932dc2b6cacef13fcf8a0694
  Author: David Blaikie <dblaikie at gmail.com>
  Date:   2021-12-25 (Sat, 25 Dec 2021)

  Changed paths:
    M llvm/include/llvm/CodeGen/DIE.h
    M llvm/lib/CodeGen/AsmPrinter/ByteStreamer.h
    M llvm/lib/CodeGen/AsmPrinter/DIEHash.cpp
    M llvm/lib/CodeGen/AsmPrinter/DIEHash.h
    M llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
    M llvm/test/DebugInfo/X86/convert-loclist.ll

  Log Message:
  DebugInfo: Don't hash DIE offsets before they're computed

Instead of hashing DIE offsets, hash DIE references the same as they
would be when used outside of a loclist - that is, deep hash the type on
first use, and hash the numbering on subsequent uses.

This does produce different hashes for different type references, where
it did not before (because we were hashing zero all the time - so it
didn't matter what type was referenced, the hash would be identical).

This also allows us to enforce that the DIE offset (& size) is not
queried before it is used (which came up while investigating another bug

More information about the All-commits mailing list