[llvm] a84e1e6 - [DWARF] Add linkagename to hash

Alexander Yermolovich via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 8 10:16:58 PDT 2022


Author: Alexander Yermolovich
Date: 2022-07-08T10:15:25-07:00
New Revision: a84e1e6c0d5d742db47d89ff6bdab19c3ccff779

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

LOG: [DWARF] Add linkagename to hash

Originally encountered with RUST, but also there are cases with distributed LTO
where debug info dwo units contain structurally the same debug information, with
difference in DW_AT_linkage_name. This causes collision on DWO ID.

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

Added: 
    

Modified: 
    llvm/lib/CodeGen/AsmPrinter/DIEHashAttributes.def
    llvm/test/DebugInfo/X86/convert-loclist.ll
    llvm/test/DebugInfo/X86/fission-hash-local.ll
    llvm/test/DebugInfo/X86/sret.ll
    llvm/unittests/CodeGen/DIEHashTest.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AsmPrinter/DIEHashAttributes.def b/llvm/lib/CodeGen/AsmPrinter/DIEHashAttributes.def
index 28a02390fccb6..c872d0dd2dfa5 100644
--- a/llvm/lib/CodeGen/AsmPrinter/DIEHashAttributes.def
+++ b/llvm/lib/CodeGen/AsmPrinter/DIEHashAttributes.def
@@ -51,5 +51,5 @@ HANDLE_DIE_HASH_ATTR(DW_AT_virtuality)
 HANDLE_DIE_HASH_ATTR(DW_AT_visibility)
 HANDLE_DIE_HASH_ATTR(DW_AT_vtable_elem_location)
 HANDLE_DIE_HASH_ATTR(DW_AT_type)
-
+HANDLE_DIE_HASH_ATTR(DW_AT_linkage_name)
 #undef HANDLE_DIE_HASH_ATTR

diff  --git a/llvm/test/DebugInfo/X86/convert-loclist.ll b/llvm/test/DebugInfo/X86/convert-loclist.ll
index e3d5522c7e26c..eb3c4128e9166 100644
--- a/llvm/test/DebugInfo/X86/convert-loclist.ll
+++ b/llvm/test/DebugInfo/X86/convert-loclist.ll
@@ -13,7 +13,7 @@
 ; often - add another IR file with a 
diff erent DW_OP_convert that's otherwise
 ; identical and demonstrate that they have 
diff erent DWO IDs.
 
-; SPLIT: 0x00000000: Compile Unit: {{.*}} DWO_id = 0xa6edbf487b0a7acf
+; SPLIT: 0x00000000: Compile Unit: {{.*}} DWO_id = 0x4dbee91db55385db
 
 ; Regression testing a fairly quirky bug where instead of hashing (see above),
 ; extra bytes would be emitted into the output assembly in no

diff  --git a/llvm/test/DebugInfo/X86/fission-hash-local.ll b/llvm/test/DebugInfo/X86/fission-hash-local.ll
index ff0eb4052b62b..3abca0176227c 100644
--- a/llvm/test/DebugInfo/X86/fission-hash-local.ll
+++ b/llvm/test/DebugInfo/X86/fission-hash-local.ll
@@ -13,8 +13,8 @@
 ;   int i = 7; // or 9
 ; }
 
-; H1: DW_AT_GNU_dwo_id  (0x03a55a70550ee09b)
-; H2: DW_AT_GNU_dwo_id  (0x826fcafbddebc96b)
+; H1: DW_AT_GNU_dwo_id  (0xc1220cf66b1190ad)
+; H2: DW_AT_GNU_dwo_id  (0xf66067a0cf366f0e)
 
 ; Function Attrs: norecurse nounwind readnone uwtable
 define dso_local void @_Z2f1v() local_unnamed_addr !dbg !7 {

diff  --git a/llvm/test/DebugInfo/X86/sret.ll b/llvm/test/DebugInfo/X86/sret.ll
index 479f2f605421a..ccd1cefca31aa 100644
--- a/llvm/test/DebugInfo/X86/sret.ll
+++ b/llvm/test/DebugInfo/X86/sret.ll
@@ -3,8 +3,8 @@
 
 ; Based on the debuginfo-tests/sret.cpp code.
 
-; CHECK-DWO: DW_AT_GNU_dwo_id (0xa58a336e896549f1)
-; CHECK-DWO: DW_AT_GNU_dwo_id (0xa58a336e896549f1)
+; CHECK-DWO: DW_AT_GNU_dwo_id (0x7db1cc8453a47c44)
+; CHECK-DWO: DW_AT_GNU_dwo_id (0x7db1cc8453a47c44)
 
 ; RUN: llc -O0 -fast-isel=true -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,FASTISEL %s
 ; RUN: llc -O0 -fast-isel=false -mtriple=x86_64-apple-darwin -filetype=obj -o - %s | llvm-dwarfdump -debug-info - | FileCheck -check-prefixes=CHECK,SDAG %s

diff  --git a/llvm/unittests/CodeGen/DIEHashTest.cpp b/llvm/unittests/CodeGen/DIEHashTest.cpp
index b86c36263bd8a..e8b3222005196 100644
--- a/llvm/unittests/CodeGen/DIEHashTest.cpp
+++ b/llvm/unittests/CodeGen/DIEHashTest.cpp
@@ -73,7 +73,7 @@ TEST_F(DIEHashTest, TrivialType) {
   uint64_t MD5Res = DIEHash().computeTypeSignature(Unnamed);
 
   // The exact same hash GCC produces for this DIE.
-  ASSERT_EQ(0x715305ce6cfd9ad1ULL, MD5Res);
+  ASSERT_EQ(0x715305CE6CFD9AD1ULL, MD5Res);
 }
 
 // struct foo { };
@@ -87,7 +87,7 @@ TEST_F(DIEHashTest, NamedType) {
   uint64_t MD5Res = DIEHash().computeTypeSignature(Foo);
 
   // The exact same hash GCC produces for this DIE.
-  ASSERT_EQ(0xd566dbd2ca5265ffULL, MD5Res);
+  ASSERT_EQ(0xD566DBD2CA5265FFULL, MD5Res);
 }
 
 // namespace space { struct foo { }; }
@@ -606,7 +606,7 @@ TEST_F(DIEHashTest, MemberFuncFlag) {
   uint64_t MD5Res = DIEHash().computeTypeSignature(A);
 
   // The exact same hash GCC produces for this DIE.
-  ASSERT_EQ(0x8f78211ddce3df10ULL, MD5Res);
+  ASSERT_EQ(0x8F78211DDCE3DF10ULL, MD5Res);
 }
 
 // Derived from:
@@ -652,7 +652,7 @@ TEST_F(DIEHashTest, MemberSdata) {
   A.addChild(std::move(PI));
 
   uint64_t MD5Res = DIEHash().computeTypeSignature(A);
-  ASSERT_EQ(0x9a216000dd3788a7ULL, MD5Res);
+  ASSERT_EQ(0x9A216000DD3788A7ULL, MD5Res);
 }
 
 // Derived from:
@@ -713,6 +713,6 @@ TEST_F(DIEHashTest, MemberBlock) {
   A.addChild(std::move(PI));
 
   uint64_t MD5Res = DIEHash(this->getAsmPrinter()).computeTypeSignature(A);
-  ASSERT_EQ(0x493af53ad3d3f651ULL, MD5Res);
+  ASSERT_EQ(0x493AF53AD3D3F651ULL, MD5Res);
 }
 }


        


More information about the llvm-commits mailing list