<html><head><base href="x-msg://107/"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class=""><br class=""><div><div class="">On Apr 15, 2011, at 2:21 PM, Villmow, Micah wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; " class="Apple-style-span"><div bgcolor="white" lang="EN-US" link="blue" vlink="purple" class=""><div style="page: WordSection1; " class="WordSection1"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">John/Richard,<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">I think I have found the problem to why the debug information is getting destroyed. The problem is in SelectionDAG and how it interacts with the SDDbgValue nodes and custom SDNodes.<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">When the dbg_value intrinsic is encountered, it adds the debug value to a specific SD Node in SelectionDAGBuilder.cpp::visitIntrinsicCall(). In one of my cases, it is vector_extract_elt.<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">During ISelLowering, the vector_extract_elt instruction is lowered to a custom backend SDNode and all of the operands are transferred over. The SDNode that stored vector_extract_elt is then deleted as it has no more uses. This then invalidates the debug information, causing it to no longer be printed. As the new SDNode has a debug loc, but not a corresponding SDDbgValue, it correctly shows dbg:<filename>:line:col when printing the DAG, but not during assembly printing.</span></div></div></div></span></blockquote><div><br class=""></div><blockquote type="cite"><span style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; " class="Apple-style-span"><div bgcolor="white" lang="EN-US" link="blue" vlink="purple" class=""><div style="page: WordSection1; " class="WordSection1"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">So, now that I’ve figured out what the problem is, anyone have an idea on how to fix it? Should getNode create a new SDDbgValue from a DebugLoc everytime? Should the DAG update the SDDbgValue to point to a new node when getNode is created?<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""></span></div></div></div></span></blockquote><div><br class=""></div><div><br class=""></div><div><span style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; " class="Apple-style-span"><div bgcolor="white" lang="EN-US" link="blue" vlink="purple" class=""><div style="page: WordSection1; " class="WordSection1">You want to transfer SDDbgValue from old node to new node using SelectionDag::TransferDbgValues(From, To).<br class=""><blockquote type="cite"><span style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; " class="Apple-style-span"><div bgcolor="white" lang="EN-US" link="blue" vlink="purple" class=""><div style="page: WordSection1; " class="WordSection1"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""></o:p></span></div></div></div></span></blockquote></div></div></span></div><div><br class=""></div><div>-</div><div>Devang</div><div><br></div><br class=""><blockquote type="cite"><span style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; " class="Apple-style-span"><div bgcolor="white" lang="EN-US" link="blue" vlink="purple" class=""><div style="page: WordSection1; " class="WordSection1"><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">Any other ideas?<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">Thanks,<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">Micah<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: blue; border-left-width: 1.5pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 4pt; " class=""><div class=""><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; " class=""><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><b class=""><span style="font-size: 10pt; font-family: Tahoma, sans-serif; color: windowtext; " class="">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; color: windowtext; " class=""><span class="Apple-converted-space"> </span>Relph, Richard<span class="Apple-converted-space"> </span><br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Friday, April 15, 2011 8:42 AM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>John Criswell; Villmow, Micah<br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvmdev@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">llvmdev@cs.uiuc.edu</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>RE: [LLVMdev] Valid debug information being deleted by DAGCombiner<o:p class=""></o:p></span></div></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><o:p class=""> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">John,<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">    Mem2reg actually modifies debug information in a way that at least suggests it’s trying to maintain debugability. Specifically, it changes llvm.dbg.declare() calls (appropriate for variables that permanently reside in a single place) to llvm.dbg.value() calls (specifying that at this instant, this variable is in this register).<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">    In fact, the .bc after inlining and mem2reg optimizations seems correct. Llvm.dbg.value() refers to a chain of single-input phi nodes left behind by inlining that ultimately resolve to the value in the inlined function that corresponds to the return value. But when code gen does its thing, DAGCombiner thinks some of the llvm.dbg.value() calls are associated with dead assignments and removes them. Only we haven’t been able to figure out why DAGCombiner is sometimes confused. For example (from a slightly different test case than Micah posted), here’s a block of post-optimized IR for a dbg.value() call that the DAGCombiner ends up deleting…<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  %8 = extractelement <4 x i32> %7, i32 0         ; <i32> [#uses=1]<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  br label %9<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">; <label>:9                                       ; preds = %get_local_id.exit<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  %10 = phi i32 [ %8, %get_local_id.exit ]        ; <i32> [#uses=1]<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  br label %11<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">; <label>:11                                      ; preds = %9<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  %12 = phi i32 [ %10, %9 ]                       ; <i32> [#uses=1]<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  br label %get_global_id.exit<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">get_global_id.exit:                               ; preds = %11<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  %13 = phi i32 [ %12, %11 ]                      ; <i32> [#uses=4]<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">  call void @llvm.dbg.value(metadata !{i32 %13}, i64 0, metadata !27), !dbg !28<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">    However, a similar sequence of IR ‘works’, IF that sequence’s analog to %13 is used in the SAME basic block as the assignment to %13. It’s only if %13 is not used in the same basic block that the dbg.value gets removed. Or at least that’s the feeling we have at this point.<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">Thanks,<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">Richard<o:p class=""></o:p></span></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""><o:p class=""> </o:p></span></div><div style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: blue; border-left-width: 1.5pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 4pt; " class=""><div class=""><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: rgb(181, 196, 223); border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; " class=""><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><b class=""><span style="font-size: 10pt; font-family: Tahoma, sans-serif; color: windowtext; " class="">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; color: windowtext; " class=""><span class="Apple-converted-space"> </span><a href="mailto:llvmdev-bounces@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">llvmdev-bounces@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>[mailto:llvmdev-bounces@cs.uiuc.edu]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>John Criswell<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, April 14, 2011 7:07 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span>Villmow, Micah<br class=""><b class="">Cc:</b><span class="Apple-converted-space"> </span><a href="mailto:llvmdev@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">llvmdev@cs.uiuc.edu</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>Re: [LLVMdev] Valid debug information being deleted by DAGCombiner<o:p class=""></o:p></span></div></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><o:p class=""> </o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">On 4/14/11 8:22 PM, Villmow, Micah wrote:<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">Found another bitcode file where a debug symbol is being dropped.</span><o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""> </span><o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class="">In the attached bitcode file, the variable gid is not in the debug output.</span><o:p class=""></o:p></div><p style="margin-top: 0in; margin-right: 0in; margin-bottom: 12pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="MsoNormal"><span style="font-size: 12pt; font-family: 'Times New Roman', serif; " class=""><br class="">Dumb question: Have you looked to see if mem2reg is destroying (or not maintaining) the debug information of interest (or put another way, was the variable gid promoted to an LLVM register and therefore had its debug information destroyed)?<br class=""><br class="">I haven't used LLVM's new debug facilities, so my knowledge is out of date, but I think optimizations are still permitted to remove debug info.<br class=""><br class="">-- John T.<br class=""><br class=""><o:p class=""></o:p></span></p><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="color: rgb(31, 73, 125); " class=""> </span><o:p class=""></o:p></div><div style="border-top-style: none; border-right-style: none; border-bottom-style: none; border-width: initial; border-color: initial; border-left-style: solid; border-left-color: windowtext; border-left-width: 1.5pt; padding-top: 0in; padding-right: 0in; padding-bottom: 0in; padding-left: 4pt; " class=""><div class=""><div style="border-right-style: none; border-bottom-style: none; border-left-style: none; border-width: initial; border-color: initial; border-top-style: solid; border-top-color: windowtext; border-top-width: 1pt; padding-top: 3pt; padding-right: 0in; padding-bottom: 0in; padding-left: 0in; " class=""><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><b class=""><span style="font-size: 10pt; font-family: Tahoma, sans-serif; " class="">From:</span></b><span style="font-size: 10pt; font-family: Tahoma, sans-serif; " class=""><span class="Apple-converted-space"> </span><a href="mailto:llvmdev-bounces@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">llvmdev-bounces@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>[<a href="mailto:llvmdev-bounces@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">mailto:llvmdev-bounces@cs.uiuc.edu</a>]<span class="Apple-converted-space"> </span><b class="">On Behalf Of<span class="Apple-converted-space"> </span></b>Villmow, Micah<br class=""><b class="">Sent:</b><span class="Apple-converted-space"> </span>Thursday, April 14, 2011 5:31 PM<br class=""><b class="">To:</b><span class="Apple-converted-space"> </span><a href="mailto:llvmdev@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">llvmdev@cs.uiuc.edu</a><br class=""><b class="">Subject:</b><span class="Apple-converted-space"> </span>[LLVMdev] Valid debug information being deleted by DAGCombiner</span><o:p class=""></o:p></div></div></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">I am working on some debug problems that we are seeing with the x86 backend and OpenCL.<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">The input is linked.bc. There are three debug values, ip, tid and gid.<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">llc -march=x86 linked.bc -o linked-x86.s <-- assembly file has all three values in the debug info section<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">However, if I attempt to optimize the bitcode with the following command:<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">opt -disable-opt -inline-all -mem2reg linked.bc -o optimized.bc<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">llc -march=x86 optimized.bc -o optimized-x86.s <-- Assembly file only has ip and gid in the debug info section.<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">Any idea on how to get this to work? I've attached the output, which is missing the 'tid' debug variable.<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">Thanks,<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class="">Micah<o:p class=""></o:p></div><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""> <o:p class=""></o:p></div></div><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; color: black; " class=""><o:p class=""> </o:p></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; color: black; " class=""><o:p class=""> </o:p></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; color: black; " class="">_______________________________________________<o:p class=""></o:p></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; color: black; " class="">LLVM Developers mailing list<o:p class=""></o:p></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; color: black; " class=""><a href="mailto:LLVMdev@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">http://llvm.cs.uiuc.edu</a><o:p class=""></o:p></pre><pre style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 10pt; font-family: 'Courier New'; color: black; " class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="color: blue; text-decoration: underline; " class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><o:p class=""></o:p></pre><div style="margin-top: 0in; margin-right: 0in; margin-bottom: 0.0001pt; margin-left: 0in; font-size: 11pt; font-family: Calibri, sans-serif; color: black; " class=""><span style="font-size: 12pt; font-family: 'Times New Roman', serif; " class=""><o:p class=""> </o:p></span></div></div></div></div>_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:LLVMdev@cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">LLVMdev@cs.uiuc.edu</a><span class="Apple-converted-space"> </span>        <a href="http://llvm.cs.uiuc.edu" style="color: blue; text-decoration: underline; " class="">http://llvm.cs.uiuc.edu</a><br class=""><a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" style="color: blue; text-decoration: underline; " class="">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br class=""></div></span></blockquote></div><br class=""></body></html>