[PATCH] D113465: [llvm-dwarfdump] Implementation of an add-on for handling LTO cases with CCU referencing

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 9 01:25:21 PST 2021


djtodoro added a comment.

Thanks for this! Some initial comments inline.



================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/LTO_CCU_zero_loc_cov.ll:87-90
+attributes #0 = { noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
+attributes #1 = { mustprogress nofree nosync nounwind readnone speculatable willreturn }
+attributes #2 = { alwaysinline mustprogress nofree norecurse nosync nounwind readnone uwtable willreturn "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
+attributes #3 = { nofree nosync nounwind readnone speculatable willreturn }
----------------
I think we don't need these attributes, so we can get rid of them.


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/LTO_CCU_zero_loc_cov.ll:96
+
+!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 14.0.0 (https://github.com/dmilosevic141/llvm-project.git 16083be64e5aa8ae2b32be0dbfb3b383b3c562ea)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
+!1 = !DIFile(filename: "main.c", directory: "/home/syrmia/Desktop/llvm-dwarfdump-with-lto")
----------------
we can get rid of the " (https://github.com/dmilosevic141/llvm-project.git 16083be64e5aa8ae2b32be0dbfb3b383b3c562ea)" part.


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/LTO_CCU_zero_loc_cov.ll:99
+!2 = !{}
+!3 = distinct !DICompileUnit(language: DW_LANG_C99, file: !4, producer: "clang version 14.0.0 (https://github.com/dmilosevic141/llvm-project.git 16083be64e5aa8ae2b32be0dbfb3b383b3c562ea)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
+!4 = !DIFile(filename: "sum.c", directory: "/home/syrmia/Desktop/llvm-dwarfdump-with-lto")
----------------
here as well


================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/LTO_CCU_zero_loc_cov.ll:100
+!3 = distinct !DICompileUnit(language: DW_LANG_C99, file: !4, producer: "clang version 14.0.0 (https://github.com/dmilosevic141/llvm-project.git 16083be64e5aa8ae2b32be0dbfb3b383b3c562ea)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, splitDebugInlining: false, nameTableKind: None)
+!4 = !DIFile(filename: "sum.c", directory: "/home/syrmia/Desktop/llvm-dwarfdump-with-lto")
+!5 = !{!"clang version 14.0.0 (https://github.com/dmilosevic141/llvm-project.git 16083be64e5aa8ae2b32be0dbfb3b383b3c562ea)"}
----------------



================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/LTO_CCU_zero_loc_cov.ll:101
+!4 = !DIFile(filename: "sum.c", directory: "/home/syrmia/Desktop/llvm-dwarfdump-with-lto")
+!5 = !{!"clang version 14.0.0 (https://github.com/dmilosevic141/llvm-project.git 16083be64e5aa8ae2b32be0dbfb3b383b3c562ea)"}
+!6 = !{i32 7, !"Dwarf Version", i32 4}
----------------



================
Comment at: llvm/test/tools/llvm-dwarfdump/X86/LTO_CCU_zero_loc_cov.ll:129-131
+!33 = !DILocation(line: 7, column: 6, scope: !11)
+!34 = !DILocation(line: 7, column: 10, scope: !11)
+!35 = !DILocation(line: 7, column: 18, scope: !11)
----------------
all these three locations can be replaced with just one (and also all the other locations with the same scope could be removed/replaced)


================
Comment at: llvm/tools/llvm-dwarfdump/Statistics.cpp:47
+/// This represents DWARF locations of CrossCU referencing DIEs.
+using CrossCUReferencingDIELocationTy = llvm::SmallVector<std::unique_ptr<DIELocation>>;
+
----------------
is this clang-formatted?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D113465/new/

https://reviews.llvm.org/D113465



More information about the llvm-commits mailing list