<div dir="ltr">Hi Jonas,<div><br></div><div>Thank you very much for your response. It seems that the changes you pointed is the fix for the issue I have.</div><div>I am not able to test  that revision but I found a workaround using the logic of the fix.</div><div><br></div><div>Regards,</div><div>Arsen</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 15, 2018 at 4:04 PM, Jonas Devlieghere <span dir="ltr"><<a href="mailto:jdevlieghere@apple.com" target="_blank">jdevlieghere@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word;line-break:after-white-space"><div>+ Adrian</div><div><div>+ David</div></div><div><br></div>Hi Arsen,<div><br></div><div>This sounds like a bug to me. Have you tried reproducing it on trunk? For instance, I see that the relation between DICompileUnit and DISubprogram was changed in the meantime (<a href="https://reviews.llvm.org/D19034" target="_blank">https://reviews.llvm.org/<wbr>D19034</a>).</div><div><br></div><div>If this no longer occurs on master you could bisect the compiler to find the commit(s) that fix this and consider backporting them locally. If not, you should file a bug on <a href="http://bugs.llvm.org" target="_blank">bugs.llvm.org</a> and attach the source and commands you’re running. I’d be happy to take a look at it. </div><div><br></div><div>Jonas</div><div><br></div><div><div><div><br><blockquote type="cite"><div><div class="h5"><div>On 14 Jan 2018, at 16:33, Arsen Hakobyan via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="m_-1222075611474099178Apple-interchange-newline"></div></div><div><div><div class="h5"><div dir="ltr" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">Thanks Paul,<div>Hi Adrian and David I would really appreciate any comments, thoughts assumptions.</div><div><br></div><div>If additional information is needed please let me know.</div><div><br></div><div>Regards,</div><div>Arsen </div></div><div class="gmail_extra" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><br><div class="gmail_quote">On Sat, Jan 13, 2018 at 2:54 AM, Robinson, Paul<span class="m_-1222075611474099178Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:paul.robinson@sony.com" target="_blank">paul.robinson@sony.com</a>></span><span class="m_-1222075611474099178Apple-converted-space"> </span><wbr>wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div lang="EN-US" link="blue" vlink="purple"><div class="m_-1222075611474099178m_8879198985773454742WordSection1"><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">Hi Arsen, we are beyond what I understand about how metadata operates.  Maybe Adrian or David knows.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">--paulr<u></u><u></u></span></p><p class="MsoNormal"><a name="m_-1222075611474099178_m_8879198985773454742__MailEndCompose"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"><u></u> <u></u></span></a></p><div style="border-style:none none none solid;border-left-width:1.5pt;border-left-color:blue;padding:0in 0in 0in 4pt"><div><div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"><span class="m_-1222075611474099178Apple-converted-space"> </span>Arsen Hakobyan [mailto:<a href="mailto:hakobyan.ars@gmail.com" target="_blank">hakobyan.ars@gmail.com</a><wbr>]<span class="m_-1222075611474099178Apple-converted-space"> </span><br><b>Sent:</b><span class="m_-1222075611474099178Apple-converted-space"> </span>Friday, January 12, 2018 12:16 PM<br><b>To:</b><span class="m_-1222075611474099178Apple-converted-space"> </span>Robinson, Paul<br><b>Cc:</b><span class="m_-1222075611474099178Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>; David Blaikie<br><b>Subject:</b><span class="m_-1222075611474099178Apple-converted-space"> </span>Re: [llvm-dev] StripDeadDebugInfo for static inline functions.<u></u><u></u></span></p></div></div><div><div class="m_-1222075611474099178h5"><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">Just one update:<u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">the function causing the segmentation fault is the following:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 359<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(52,188,38)">void</span><span style="font-size:8.5pt;font-family:Menlo,serif"><span class="m_-1222075611474099178Apple-converted-space"> </span>DwarfDebug::construc<wbr>tAbstractSubprogramScopeDIE(<wbr>LexicalScope *Scope) {<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 360<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>assert(Scope && Scope->getScopeNode());<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 361<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>assert(Scope-><wbr>isAbstractScope());<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 362<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>assert(!Scope-><wbr>getInlinedAt());<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 363 <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 364<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(52,188,38)">const</span><span style="font-size:8.5pt;font-family:Menlo,serif"><span class="m_-1222075611474099178Apple-converted-space"> </span>MDNode *SP = Scope->getScopeNode();<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 365 <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 366<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>ProcessedSPNodes.<wbr>insert(SP);<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 367 <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 368<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(82,48,225)">// Find the subprogram's DwarfCompileUnit in the SPMap in case the subprogram<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 369<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(82,48,225)">// was inlined from another compile unit.<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 370<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(52,188,38)">auto</span><span style="font-size:8.5pt;font-family:Menlo,serif"><span class="m_-1222075611474099178Apple-converted-space"> </span>&CU = SPMap[SP];<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 371<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>forBothCUs(*CU, [&](DwarfCompileUnit &CU) {<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 372<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif">   <span class="m_-1222075611474099178Apple-converted-space"> </span>CU.constructAbstractSubprogr<wbr>amScopeDIE(Scope);<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 373<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>});<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"> 374<span class="m_-1222075611474099178Apple-converted-space"> </span></span><span style="font-size:8.5pt;font-family:Menlo,serif">}</span><span style="font-size:8.5pt;font-family:Menlo,serif;color:rgb(205,121,35)"><u></u><u></u></span></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span>Here I checked that "</span><span style="font-size:8.5pt;font-family:Menlo,serif">SPMap.<span style="background-color:rgb(0,166,179);background-position:initial initial;background-repeat:initial initial">lookup</span>(Scope->getScopeN<wbr>ode());" returns null. If the transformation does right things then probably there is other issue and SPMap[SP] for inlined function should find the main CompileUnit anyway.  What do you think about this?</span><u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo,serif">Regards,</span><u></u><u></u></p></div><div><p class="MsoNormal"><span style="font-size:8.5pt;font-family:Menlo,serif">Arsen</span><u></u><u></u></p></div></div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Sat, Jan 13, 2018 at 12:11 AM, Arsen Hakobyan <<a href="mailto:hakobyan.ars@gmail.com" target="_blank">hakobyan.ars@gmail.com</a>> wrote:<u></u><u></u></p><div><p class="MsoNormal">Hi Paul, <u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thanks for your response.<u></u><u></u></p></div><div><p class="MsoNormal">Let me actually post more details visualizing my case. Assuming that can help.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">so the IR before the opt tool is running is:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">; Function Attrs: nounwind<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">define i16 @main() #0 !dbg !13 {<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">entry:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>%retval = alloca i16, align 1<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">   <span class="m_-1222075611474099178Apple-converted-space"> </span>...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal;min-height:13px"><span style="font-size:8.5pt;font-family:Menlo,serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">; Function Attrs: inlinehint nounwind<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">define internal void @delay(i16 %d) #4 !dbg !69 {<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">entry:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>%d.addr = alloca i16, align 1<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>%i = alloca i16, align 1<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal;min-height:13px"><span style="font-size:8.5pt;font-family:Menlo,serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!<a href="http://llvm.dbg.cu/" target="_blank">llvm.dbg.cu</a><span class="m_-1222075611474099178Apple-converted-space"> </span>= !{!0}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!llvm.module.flags = !{!84, !85}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!llvm.ident = !{!86}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 Revision 72230", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !73)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!12 = !{!13, !54, !57, !60, !61, !62, !65, !66, !67, !68, !69}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!13 = distinct !DISubprogram(name: "main", scope: !14, file: !14, line: 15, type: !15, isLocal: false, isDefinition: true, scopeLine: 15, isOptimized: true, variables: !17)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!54 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!57 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!60 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!61 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!62 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!65 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!66 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!67 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!68 = distinct !DISubprogram(name: ...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!69 = distinct !DISubprogram(name: "delay", scope: !14, file: !14, line: 9, type: !55, isLocal: true, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, variables: !70)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!70 = !{!71, !72}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!71 = !DILocalVariable(name: "d", arg: 1, scope: !69, file: !14, line: 9, type: !11)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!72 = !DILocalVariable(name: "i", scope: !69, file: !14, line: 9, type: !11)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">...<u></u><u></u></span></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">The IR after opt is:<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">; Function Attrs: nounwind<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">define i16 @main() #0 !dbg !13 {<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">entry:<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif"> <span class="m_-1222075611474099178Apple-converted-space"> </span>...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">}   <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal;min-height:13px"><span style="font-size:8.5pt;font-family:Menlo,serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!<a href="http://llvm.dbg.cu/" target="_blank">llvm.dbg.cu</a><span class="m_-1222075611474099178Apple-converted-space"> </span>= !{!0}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!llvm.module.flags = !{!64, !65}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!llvm.ident = !{!66} <u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal;min-height:13px"><span style="font-size:8.5pt;font-family:Menlo,serif"><u></u> <u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.8.0 Revision 72230", isOptimized: true, runtimeVersion: 0, emissionKind: 1, enums: !2, retainedTypes: !3, subprograms: !12, globals: !54)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!12 = !{!13}<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!13 = distinct !DISubprogram(name: "main", scope: !14, file: !14, line: 15, type: !15, isLocal: false, isDefinition: true, scopeLine: 15, isOptimized: true, variables: !17)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!14 = !DIFile(filename: "main.c", directory: "path_to_directory")<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!68 = !DILocalVariable(name: "d", arg: 1, scope: !69, file: !14, line: 9, type: !11)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!69 = distinct !DISubprogram(name: "delay", scope: !14, file: !14, line: 9, type: !70, isLocal: true, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, variables: !72)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">...<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">!73 = !DILocalVariable(name: "i", scope: !69, file: !14, line: 9, type: !11)<u></u><u></u></span></div><div style="margin:0in 0in 0.0001pt;font-stretch:normal"><span style="font-size:8.5pt;font-family:Menlo,serif">... <u></u><u></u></span></div></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">I checked the StripSymbol.cpp file and there is no difference between version I am using (from clang 3.8) and current (6.0.0) version.<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">As you can see the !12 node does not contain reference to !69 after optimizations which I think is incorrect. I assume that !69 has not been removed because there are two nodes (!68 and !73) referenced to it as the scope. But that should force the transformations to not remove the link from !12. Is it right?<u></u><u></u></p></div><div><p class="MsoNormal"><u></u> <u></u></p></div><div><p class="MsoNormal">Thank you very much.<u></u><u></u></p></div><div><p class="MsoNormal"><span style="color:rgb(136,136,136)">Arsen<u></u><u></u></span></p></div><div><p class="MsoNormal"><span style="color:rgb(136,136,136)"><u></u> <u></u></span></p></div></div><div><div><div><p class="MsoNormal"><u></u> <u></u></p><div><p class="MsoNormal">On Fri, Jan 12, 2018 at 10:21 PM, Robinson, Paul <<a href="mailto:paul.robinson@sony.com" target="_blank">paul.robinson@sony.com</a>> wrote:<u></u><u></u></p><div><div><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">I'm not as familiar with all the ins and outs of metadata as maybe I should be, but ultimately the inlined function should have a DWARF description contained within the description of the caller (which is why you're seeing the call to constructAbstractSubprogramSco<wbr>peDIE).  That suggests that the DISubprogram for the inlined function ought to remain, and its scope should be the DICompileUnit.</span><u></u><u></u></p><p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)">--paulr</span><u></u><u></u></p><p class="MsoNormal"><a name="m_-1222075611474099178_m_8879198985773454742_m_-1677069743473896569_m_600397516357848"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:rgb(31,73,125)"> </span></a><u></u><u></u></p><div style="border-style:none none none solid;border-left-width:1.5pt;border-left-color:blue;padding:0in 0in 0in 4pt"><div><div style="border-style:solid none none;border-top-width:1pt;border-top-color:rgb(181,196,223);padding:3pt 0in 0in"><p class="MsoNormal"><b><span style="font-size:10pt;font-family:Tahoma,sans-serif">From:</span></b><span style="font-size:10pt;font-family:Tahoma,sans-serif"><span class="m_-1222075611474099178Apple-converted-space"> </span>llvm-dev [mailto:<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists<wbr>.llvm.org</a>]<span class="m_-1222075611474099178Apple-converted-space"> </span><b>On Behalf Of<span class="m_-1222075611474099178Apple-converted-space"> </span></b>Arsen Hakobyan via llvm-dev<br><b>Sent:</b><span class="m_-1222075611474099178Apple-converted-space"> </span>Friday, January 12, 2018 1:57 AM<br><b>To:</b><span class="m_-1222075611474099178Apple-converted-space"> </span><a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br><b>Subject:</b><span class="m_-1222075611474099178Apple-converted-space"> </span>[llvm-dev] StripDeadDebugInfo for static inline functions.</span><u></u><u></u></p></div></div><div><div><p class="MsoNormal"> <u></u><u></u></p><div><div><p class="MsoNormal">Hi all,<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">I would like to understand the strip-dead-debug-info transformation. <u></u><u></u></p></div><div><p class="MsoNormal">In my test case there is a static inline function with two local variables.<u></u><u></u></p></div><div><p class="MsoNormal">It appears that the function is already inlined before strip-dead-debug-info starts its work. As a result the DICompileUnit is cleaned and its subprograms list has no reference to the DISubprogram for the inlined function, but as there is reference from the DILocalVariables to the DISubprogram it remains (IMHO).<u></u><u></u></p></div><div><p class="MsoNormal">This caused to a segmentation fault while running llc on the optimized IR file at function "constructAbstractSubprogramSc<wbr>opeDIE" in file DwarfDebug.cpp because the scope of the DISubprogram is null (I assume it should be the DICompileUnit).<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">So I would like to know what would be the correct solution for this issue: Update optimization to not remove reference from the subprograms list, or to skip finding scope in llc.<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Any help is highly appreciated.<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal">Thanks,<u></u><u></u></p></div><div><p class="MsoNormal">Arsen<u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><div><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal">--<u></u><u></u></p><div><div><div><p class="MsoNormal"> <u></u><u></u></p></div><p class="MsoNormal"><span style="color:rgb(68,68,68)">If it's not fun you're not doing it right -- Fran Tarkenton</span><u></u><u></u></p></div></div></div></div></div></div></div></div></div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">--<span class="m_-1222075611474099178Apple-converted-space"> </span><u></u><u></u></p><div><div><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal"><span style="color:rgb(68,68,68)">If it's not fun you're not doing it right -- Fran Tarkenton</span><u></u><u></u></p></div></div></div></div></div></div><p class="MsoNormal"><br><br clear="all"><u></u><u></u></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">--<span class="m_-1222075611474099178Apple-converted-space"> </span><u></u><u></u></p><div><div><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal"><span style="color:rgb(68,68,68)">If it's not fun you're not doing it right -- Fran Tarkenton</span><u></u><u></u></p></div></div></div></div></div></div></div></div></blockquote></div><br><br clear="all"><div><br></div>--<span class="m_-1222075611474099178Apple-converted-space"> </span><br><div class="m_-1222075611474099178gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br></div><font color="#444444">If it's not fun you're not doing it right -- Fran Tarkenton</font><br></div></div></div></div></div><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">______________________________<wbr>_________________</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><span style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;float:none;display:inline!important">LLVM Developers mailing list</span><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="mailto:llvm-dev@lists.llvm.org" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">llvm-dev@lists.llvm.org</a><br style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" style="font-family:Helvetica;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a></div></blockquote></div><br></div></div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><br></div><font color="#444444">If it's not fun you're not doing it right -- Fran Tarkenton</font><br></div></div>
</div>