[PATCH] D79602: [SimplifyCFG] Remap rewritten debug intrinsic operands.

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 8 00:29:39 PDT 2020


djtodoro added a comment.

Thanks for this!
The change looks good to me, but I think we should trim the test a bit. Please find some advices below.



================
Comment at: llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll:87
+; Function Attrs: argmemonly nounwind
+declare void @llvm.lifetime.start.p0i8(i64, i8* nocapture)
+
----------------
Can we get rid of using this?


================
Comment at: llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll:90
+; Function Attrs: nounwind readnone speculatable
+declare void @llvm.dbg.declare(metadata, metadata, metadata)
+
----------------
This is unused, so please delete this.


================
Comment at: llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll:103
+; Function Attrs: argmemonly nounwind
+declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture)
+
----------------
Can we get rid of using this?


================
Comment at: llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll:116
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.1-4 (tags/RELEASE_801/final)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "/usr/local/google/home/rickyz/test.cc", directory: "/usr/local/google/home/rickyz")
+!2 = !{}
----------------
`filename: "test.cc", directory: "/dir"`


================
Comment at: llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll:123
+!7 = distinct !DISubprogram(name: "test", linkageName: "_Z4testv", scope: !8, file: !8, line: 1, type: !9, scopeLine: 1, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !11)
+!8 = !DIFile(filename: "test.cc", directory: "/usr/local/google/home/rickyz")
+!9 = !DISubroutineType(types: !10)
----------------
`directory: /dir`


================
Comment at: llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll:136
+!20 = !{!"omnipotent char", !21, i64 0}
+!21 = !{!"Simple C++ TBAA"}
+!22 = !DILocation(line: 3, column: 3, scope: !7)
----------------
I guess we don't need TBAA for this test.


================
Comment at: llvm/test/DebugInfo/simplify-cfg-preserve-dbg-values.ll:137
+!21 = !{!"Simple C++ TBAA"}
+!22 = !DILocation(line: 3, column: 3, scope: !7)
+!23 = !DILocation(line: 3, column: 8, scope: !7)
----------------
Little trick to trim the test: you can use only one location for all other locations with the same scope, e.g.:

all !`dbg !23, !dbg !24, !dbg !25, !dbg !26` replace with `!dbg !22`, and then delete these unused`DILocations`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79602





More information about the llvm-commits mailing list