[PATCH] D50887: [DWARF] Missing location debug information with -O2.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 17 10:41:38 PDT 2018


vsk added a comment.

Thanks for doing this!



================
Comment at: lib/CodeGen/MachineInstr.cpp:2029
+void MachineInstr::collectDebugValues(
+                                SmallVectorImpl<MachineInstr *> &DbgValues) {
+  MachineInstr &MI = *this;
----------------
aprantl wrote:
> I understand that this is not your code, but is there a way to use the list of USEs instead of linearily scanning through all instructions? I'm not sure if MIR has that capability, so it's possible that the answer is no.
`MachineInstrIterator::use_instructions(Reg)` should do it, and a MRI should be available in the contexts where collecting debug values is a useful thing to do. @CarlosAlbertoEnciso would you mind trying that out? It might require moving `collectDebugValues` elsewhere, but it could be a nice simplification. (I haven't tried this myself, & it's possible this won't work out, in which case we can look at it in a follow-up.)


================
Comment at: test/Transforms/EarlyCSE/debuginfo-locations-dce.ll:2
+; RUN: llc -O2 %s -o %t -filetype=obj
+; RUN: llvm-dwarfdump -debug-info %t | FileCheck %s
+
----------------
Since you're modifying the backend CSE pass, and the test requires a host compiler with X86 support, I think this test belongs in test/CodeGen/X86.


Repository:
  rL LLVM

https://reviews.llvm.org/D50887





More information about the llvm-commits mailing list