<div dir="ltr">Debug info for optimized code is not well supported in LLVM - there's lots that's not done/could be done to improve it.<br><br>I know Adrian's been looking at optimized code debug info for a bit recently & not sure if this particular situation is on his radar or not.<br><br><div class="gmail_quote"><div dir="ltr">On Thu, Feb 2, 2017 at 5:16 AM Ed Jones via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br class="gmail_msg">
<br class="gmail_msg">
I'm currently working on an out-of-tree backend and am trying to<br class="gmail_msg">
improve the debug experience when debugging optimized code. Our<br class="gmail_msg">
backend only has 8-bit and 16-bit legal types, so any larger values<br class="gmail_msg">
are expanded. The behavior I am currently seeing is that the expanded<br class="gmail_msg">
halves of an illegal type lose their debug information. Is this the<br class="gmail_msg">
expected behavior?<br class="gmail_msg">
<br class="gmail_msg">
For example, if I have an ISD::DBG_VALUE SDNode associated with a<br class="gmail_msg">
value, and that value is split up (for example a i64 load expanded<br class="gmail_msg">
into two i32 loads), I would expect to see a new ISD::DBG_VALUE<br class="gmail_msg">
tracking each fragment of the input original debug variable. However,<br class="gmail_msg">
I can't see anywhere this is handled. There seems to be some support<br class="gmail_msg">
for this, through the DW_OP_LLVM_fragment DIExpression, and there is a<br class="gmail_msg">
function DIBuilder::createFragmentExpression which could be used to<br class="gmail_msg">
create an expression to track part of a variable, however these don't<br class="gmail_msg">
seem to be used much.<br class="gmail_msg">
<br class="gmail_msg">
Thanks,<br class="gmail_msg">
Ed<br class="gmail_msg">
_______________________________________________<br class="gmail_msg">
LLVM Developers mailing list<br class="gmail_msg">
<a href="mailto:llvm-dev@lists.llvm.org" class="gmail_msg" target="_blank">llvm-dev@lists.llvm.org</a><br class="gmail_msg">
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" class="gmail_msg" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br class="gmail_msg">
</blockquote></div></div>