[PATCH] D57584: [DebugInfo][DAG] Reduce SelectionDAGs reordering of variables referring to Arguments

Bjorn Pettersson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 1 07:29:28 PST 2019


bjope added a subscriber: dstenb.
bjope added a comment.
Herald added a subscriber: llvm-commits.

Nice! Me and @dstenb actually discussed this kind of problem earlier today. So quite fun (and surprising) to see a solution pop up in the inbox.

The test case can probably be simplified a little bit (see inline comments in the test case).



================
Comment at: test/DebugInfo/X86/dbg-value-arg-movement.ll:1
+; RUN: llc -start-after=codegenprepare -stop-before=expand-isel-pseudos %s -o - | FileCheck %s
+
----------------
I think it is wise to add -mtriple in the RUN line (I never remember if it really is needed, but I think it might cause problems otherwise) .
It does not hurt that much to have it in the RUN line (even if there is a "target triple" in the IR), just to avoid the risk that some buildbot would fail otherwise.


================
Comment at: test/DebugInfo/X86/dbg-value-arg-movement.ll:84
+!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
+!1 = distinct !DIGlobalVariable(name: "lala", scope: !2, file: !3, line: 2, type: !6, isLocal: false, isDefinition: true)
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 8.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
----------------
I can't really see that "lala" is used anywhere. It should be possible to remove this, right?


================
Comment at: test/DebugInfo/X86/dbg-value-arg-movement.ll:86
+!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 8.0.0", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5, nameTableKind: None)
+!3 = !DIFile(filename: "test.c", directory: "/home/jmorse")
+!4 = !{}
----------------
Just set directory to "". Unless you really want to show your userid here :-)


================
Comment at: test/DebugInfo/X86/dbg-value-arg-movement.ll:98
+!14 = !DILocation(line: 6, column: 10, scope: !11)
+!15 = !{!16, !16, i64 0}
+!16 = !{!"int", !17, i64 0}
----------------
You do not need the TBAA metadata here.

One easy way to do cleanup some unused metadata could be to simply run
  opt -S test/DebugInfo/X86/dbg-value-arg-movement.ll
and it will strip away unused metadata automatically.

It will however not catch the unused DIGlobalVariable "lala" (unless you manually remove !0 from the list in !5 first).

And you'd ofcourse need to manually add the RUN line, and other comments including the CHECK:s again after the cleanup.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D57584





More information about the llvm-commits mailing list