[llvm] r304125 - Revert "DebugInfo: Include .dwo file name when hashing multiple CUs in a single file"

Mehdi Amini via llvm-commits llvm-commits at lists.llvm.org
Sun May 28 22:17:54 PDT 2017


Author: mehdi_amini
Date: Mon May 29 00:17:54 2017
New Revision: 304125

URL: http://llvm.org/viewvc/llvm-project?rev=304125&view=rev
Log:
Revert "DebugInfo: Include .dwo file name when hashing multiple CUs in a single file"

This reverts commit r304119 and r304118. GreenDragon is broken.

Added:
    llvm/trunk/test/DebugInfo/split-dwarf-omit-empty.ll
      - copied, changed from r304123, llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll
Removed:
    llvm/trunk/test/DebugInfo/Generic/split-dwarf-multiple-cu-hash.ll
    llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll
Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp
    llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.h
    llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp?rev=304125&r1=304124&r2=304125&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.cpp Mon May 29 00:17:54 2017
@@ -380,12 +380,10 @@ void DIEHash::computeHash(const DIE &Die
 /// DWARF4 standard. It is an md5 hash of the flattened description of the DIE
 /// with the inclusion of the full CU and all top level CU entities.
 // TODO: Initialize the type chain at 0 instead of 1 for CU signatures.
-uint64_t DIEHash::computeCUSignature(StringRef DWOName, const DIE &Die) {
+uint64_t DIEHash::computeCUSignature(const DIE &Die) {
   Numbering.clear();
   Numbering[&Die] = 1;
 
-  if (!DWOName.empty())
-    Hash.update(DWOName);
   // Hash the DIE.
   computeHash(Die);
 

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.h?rev=304125&r1=304124&r2=304125&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.h (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DIEHash.h Mon May 29 00:17:54 2017
@@ -36,7 +36,7 @@ public:
   DIEHash(AsmPrinter *A = nullptr) : AP(A) {}
 
   /// \brief Computes the CU signature.
-  uint64_t computeCUSignature(StringRef DWOName, const DIE &Die);
+  uint64_t computeCUSignature(const DIE &Die);
 
   /// \brief Computes the type signature.
   uint64_t computeTypeSignature(const DIE &Die);

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=304125&r1=304124&r2=304125&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Mon May 29 00:17:54 2017
@@ -613,13 +613,6 @@ void DwarfDebug::finalizeModuleInfo() {
 
   finishVariableDefinitions();
 
-  // Include the DWO file name in the hash if there's more than one CU.
-  // This handles ThinLTO's situation where imported CUs may very easily be
-  // duplicate with the same CU partially imported into another ThinLTO unit.
-  StringRef DWOName;
-  if (CUMap.size() > 1)
-    DWOName = Asm->TM.Options.MCOptions.SplitDwarfFile;
-
   // Handle anything that needs to be done on a per-unit basis after
   // all other generation.
   for (const auto &P : CUMap) {
@@ -634,8 +627,7 @@ void DwarfDebug::finalizeModuleInfo() {
     auto *SkCU = TheCU.getSkeleton();
     if (useSplitDwarf()) {
       // Emit a unique identifier for this CU.
-      uint64_t ID =
-          DIEHash(Asm).computeCUSignature(DWOName, TheCU.getUnitDie());
+      uint64_t ID = DIEHash(Asm).computeCUSignature(TheCU.getUnitDie());
       TheCU.addUInt(TheCU.getUnitDie(), dwarf::DW_AT_GNU_dwo_id,
                     dwarf::DW_FORM_data8, ID);
       SkCU->addUInt(SkCU->getUnitDie(), dwarf::DW_AT_GNU_dwo_id,

Removed: llvm/trunk/test/DebugInfo/Generic/split-dwarf-multiple-cu-hash.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/split-dwarf-multiple-cu-hash.ll?rev=304124&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/Generic/split-dwarf-multiple-cu-hash.ll (original)
+++ llvm/trunk/test/DebugInfo/Generic/split-dwarf-multiple-cu-hash.ll (removed)
@@ -1,40 +0,0 @@
-; RUN: %llc_dwarf -split-dwarf-file=foo.dwo  %s -filetype=obj -o %T/a.o
-; RUN: %llc_dwarf -split-dwarf-file=bar.dwo  %s -filetype=obj -o %T/b.o
-; RUN: llvm-dwarfdump -debug-dump=info %T/a.o %T/b.o | FileCheck %s
-
-; CHECK: dwo_id {{.*}}([[HASH:.*]])
-; CHECK-NOT: dwo_id {{.*}}([[HASH]])
-
-; Function Attrs: noinline nounwind uwtable
-define void @_Z1av() #0 !dbg !9 {
-entry:
-  ret void, !dbg !12
-}
-
-; Function Attrs: noinline nounwind uwtable
-define void @_Z1bv() #0 !dbg !13 {
-entry:
-  ret void, !dbg !14
-}
-
-attributes #0 = { noinline nounwind uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="true" "no-frame-pointer-elim-non-leaf" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
-
-!llvm.dbg.cu = !{!0, !3}
-!llvm.ident = !{!5, !5}
-!llvm.module.flags = !{!6, !7, !8}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 304107) (llvm/trunk 304109)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
-!1 = !DIFile(filename: "a.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
-!2 = !{}
-!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "clang version 5.0.0 (trunk 304107) (llvm/trunk 304109)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
-!4 = !DIFile(filename: "b.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
-!5 = !{!"clang version 5.0.0 (trunk 304107) (llvm/trunk 304109)"}
-!6 = !{i32 2, !"Dwarf Version", i32 4}
-!7 = !{i32 2, !"Debug Info Version", i32 3}
-!8 = !{i32 1, !"wchar_size", i32 4}
-!9 = distinct !DISubprogram(name: "a", linkageName: "_Z1av", scope: !1, file: !1, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!10 = !DISubroutineType(types: !11)
-!11 = !{null}
-!12 = !DILocation(line: 2, column: 1, scope: !9)
-!13 = distinct !DISubprogram(name: "b", linkageName: "_Z1bv", scope: !4, file: !4, line: 1, type: !10, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !3, variables: !2)
-!14 = !DILocation(line: 2, column: 1, scope: !13)

Removed: llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll?rev=304124&view=auto
==============================================================================
--- llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll (original)
+++ llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll (removed)
@@ -1,52 +0,0 @@
-; RUN: %llc_dwarf -split-dwarf-file=foo.dwo  %s -filetype=obj -o - | llvm-dwarfdump -debug-dump=info - | FileCheck %s
-
-; Created from:
-; a.cpp:
-;   void f1();
-;   inline __attribute__((always_inline)) __attribute__((used)) void f2() { f1(); }
-; b.cpp:
-;   void f2();
-;   void f3() {
-;     f2();
-;   }
-; $ clang++ -fno-split-dwarf-inlining {a,b}.cpp -emit-llvm -S -g
-; $ llvm-link {a,b}.ll -S -o ab.ll
-; Then strip out the @llvm.used global, so no out of line definition of 'f2'
-; will be emitted. This emulates something more like the available_externally
-; import performed by ThinLTO.
-
-; CHECK: Compile Unit
-; CHECK-NOT: Compile Unit
-
-declare void @_Z2f1v()
-
-; Function Attrs: noinline norecurse uwtable
-define i32 @main() !dbg !9 {
-entry:
-  call void @_Z2f1v(), !dbg !13
-  ret i32 0, !dbg !18
-}
-
-!llvm.dbg.cu = !{!0, !3}
-!llvm.ident = !{!5, !5}
-!llvm.module.flags = !{!6, !7, !8}
-
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 5.0.0 (trunk 304054) (llvm/trunk 304080)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false)
-!1 = !DIFile(filename: "a.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
-!2 = !{}
-!3 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !4, producer: "clang version 5.0.0 (trunk 304054) (llvm/trunk 304080)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false)
-!4 = !DIFile(filename: "b.cpp", directory: "/usr/local/google/home/blaikie/dev/scratch")
-!5 = !{!"clang version 5.0.0 (trunk 304054) (llvm/trunk 304080)"}
-!6 = !{i32 2, !"Dwarf Version", i32 4}
-!7 = !{i32 2, !"Debug Info Version", i32 3}
-!8 = !{i32 1, !"wchar_size", i32 4}
-!9 = distinct !DISubprogram(name: "main", scope: !4, file: !4, line: 2, type: !10, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !3, variables: !2)
-!10 = !DISubroutineType(types: !11)
-!11 = !{!12}
-!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!13 = !DILocation(line: 2, column: 73, scope: !14, inlinedAt: !17)
-!14 = distinct !DISubprogram(name: "f2", linkageName: "_Z2f2v", scope: !1, file: !1, line: 2, type: !15, isLocal: false, isDefinition: true, scopeLine: 2, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
-!15 = !DISubroutineType(types: !16)
-!16 = !{null}
-!17 = distinct !DILocation(line: 3, column: 3, scope: !9)
-!18 = !DILocation(line: 4, column: 1, scope: !9)

Copied: llvm/trunk/test/DebugInfo/split-dwarf-omit-empty.ll (from r304123, llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll)
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/split-dwarf-omit-empty.ll?p2=llvm/trunk/test/DebugInfo/split-dwarf-omit-empty.ll&p1=llvm/trunk/test/DebugInfo/Generic/split-dwarf-omit-empty.ll&r1=304123&r2=304125&rev=304125&view=diff
==============================================================================
    (empty)




More information about the llvm-commits mailing list