[llvm-dev] [RFC] Removing debug locations from ConstantSDNodes

Björn Pettersson A via llvm-dev llvm-dev at lists.llvm.org
Thu Jun 21 09:28:13 PDT 2018


Isn't this a typcial situation when the is_stmt field in the DWARF line table should be used?

If we set is_stmt=0 for the instruction loading the constant, then a debugger can choose not to stop on that instruction when doing "step" on source level. That way we can keep the original source location for a ConstantSDNode, but also telling the debugger that this isn't a recommended breakpoint location for that line. Using is_stmt=0 is ofcourse only interesting if the constant load I hoisted so that it isn't adjacent to other is_stmt=1 instructions on the same line.

/Björn

From: llvm-dev <llvm-dev-bounces at lists.llvm.org> On Behalf Of via llvm-dev
Sent: den 21 juni 2018 15:08
To: mbraun at apple.com
Cc: llvm-dev at lists.llvm.org; davidxl at google.com; jbogner at apple.com
Subject: Re: [llvm-dev] [RFC] Removing debug locations from ConstantSDNodes

mbraun at apple.com<mailto:mbraun at apple.com> wrote:

FWIW: Debug information on constants feels odd to me. They are just values not something that is executed so conceptually I would not expect them to "happen" at a specific time/place in the program. That said most numbers are copied into registers or stored into memory and that is of course an interesting action. So in the original example I would hope to see debug info on whatever instructions are used to fill the array with values.

+1.  Constants are not inherently interesting, but loading one as an action preparatory to computing a value or setting up a parameter in a call, the instruction ought to be associated with the relevant source statement.
--paulr

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180621/2c2cbf24/attachment.html>


More information about the llvm-dev mailing list