<p dir="ltr"><br>
On Sep 30, 2014 9:09 PM, "Justin Bogner" <<a href="mailto:mail@justinbogner.com">mail@justinbogner.com</a>> wrote:<br>
><br>
> David Blaikie <<a href="mailto:dblaikie@gmail.com">dblaikie@gmail.com</a>> writes:<br>
> > Author: dblaikie<br>
> > Date: Tue Sep 30 16:28:32 2014<br>
> > New Revision: 218702<br>
> ><br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218702&view=rev">http://llvm.org/viewvc/llvm-project?rev=218702&view=rev</a><br>
> > Log:<br>
> > Disable the -gmlt optimization implemented in r218129 under Darwin due<br>
> > to issues with dsymutil.<br>
><br>
> This is causing a test failure on darwin:<br>
><br>
>     <a href="http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4936/steps/run.llvm.tests/logs/LLVM%3A%3Agmlt.test">http://lab.llvm.org:8013/builders/clang-x86_64-darwin11-nobootstrap-RAincremental/builds/4936/steps/run.llvm.tests/logs/LLVM%3A%3Agmlt.test</a><br>
><br>
> I'll revert in a bit if you're not around.</p>
<p dir="ltr">If you can make that test xfail on Darwin (or just not run there - since there's a specific Darwin variant of the test) that'd be swell. It'll be easier for you to verify that that works than me (since I don't Dev on a Mac)</p>
<p dir="ltr">><br>
> > r218129 omits DW_TAG_subprograms which have no inlined subroutines when<br>
> > emitting -gmlt data. This makes -gmlt very low cost for -O0 builds.<br>
> ><br>
> > Darwin's dsymutil reasonably considers a CU empty if it has no<br>
> > subprograms (which occurs with the above optimization in -O0 programs<br>
> > without any force_inline function calls) and drops the line table, CU,<br>
> > and everything in this situation, making backtraces impossible.<br>
> ><br>
> > Until dsymutil is modified to account for this, disable this<br>
> > optimization on Darwin to preserve the desired functionality.<br>
> > (see r218545, which should be reverted after this patch, for other<br>
> > discussion/details)<br>
> ><br>
> > Footnote:<br>
> > In the long term, it doesn't look like this scheme (of simplified debug<br>
> > info to describe inlining to enable backtracing) is tenable, it is far<br>
> > too size inefficient for optimized code (the DW_TAG_inlined_subprograms,<br>
> > even once compressed, are nearly twice as large as the line table<br>
> > itself (also compressed)) and we'll be considering things like Cary's<br>
> > two level line table proposal to encode all this information directly in<br>
> > the line table.<br>
> ><br>
> > Modified:<br>
> >     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
> >     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
> >     llvm/trunk/test/DebugInfo/gmlt.ll<br>
> ><br>
> > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp<br>
> > URL:<br>
> > <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=218702&r1=218701&r2=218702&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp?rev=218702&r1=218701&r2=218702&view=diff</a><br>
> > ==============================================================================<br>
> > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp (original)<br>
> > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.cpp Tue Sep 30 16:28:32 2014<br>
> > @@ -171,6 +171,7 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Mo<br>
> >        GlobalRangeCount(0), InfoHolder(A, "info_string", DIEValueAllocator),<br>
> >        UsedNonDefaultText(false),<br>
> >        SkeletonHolder(A, "skel_string", DIEValueAllocator),<br>
> > +      IsDarwin(Triple(A->getTargetTriple()).isOSDarwin()),<br>
> >        AccelNames(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,<br>
> >                                         dwarf::DW_FORM_data4)),<br>
> >        AccelObjC(DwarfAccelTable::Atom(dwarf::DW_ATOM_die_offset,<br>
> > @@ -190,8 +191,6 @@ DwarfDebug::DwarfDebug(AsmPrinter *A, Mo<br>
> ><br>
> >    // Turn on accelerator tables for Darwin by default, pubnames by<br>
> >    // default for non-Darwin, and handle split dwarf.<br>
> > -  bool IsDarwin = Triple(A->getTargetTriple()).isOSDarwin();<br>
> > -<br>
> >    if (DwarfAccelTables == Default)<br>
> >      HasDwarfAccelTables = IsDarwin;<br>
> >    else<br>
> > @@ -1698,7 +1697,7 @@ void DwarfDebug::endFunction(const Machi<br>
> >    // Under -gmlt, skip building the subprogram if there are no inlined<br>
> >    // subroutines inside it.<br>
> >    if (TheCU.getCUNode().getEmissionKind() == DIBuilder::LineTablesOnly &&<br>
> > -      LScopes.getAbstractScopesList().empty()) {<br>
> > +      LScopes.getAbstractScopesList().empty() && !IsDarwin) {<br>
> >      assert(ScopeVariables.empty());<br>
> >      assert(CurrentFnArguments.empty());<br>
> >      assert(DbgValues.empty());<br>
> ><br>
> > Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=218702&r1=218701&r2=218702&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h?rev=218702&r1=218701&r2=218702&view=diff</a><br>
> > ==============================================================================<br>
> > --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h (original)<br>
> > +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfDebug.h Tue Sep 30 16:28:32 2014<br>
> > @@ -319,6 +319,7 @@ class DwarfDebug : public AsmPrinterHand<br>
> ><br>
> >    // True iff there are multiple CUs in this module.<br>
> >    bool SingleCU;<br>
> > +  bool IsDarwin;<br>
> ><br>
> >    AddressPool AddrPool;<br>
> ><br>
> ><br>
> > Modified: llvm/trunk/test/DebugInfo/gmlt.ll<br>
> > URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/gmlt.ll?rev=218702&r1=218701&r2=218702&view=diff">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/gmlt.ll?rev=218702&r1=218701&r2=218702&view=diff</a><br>
> > ==============================================================================<br>
> > --- llvm/trunk/test/DebugInfo/gmlt.ll (original)<br>
> > +++ llvm/trunk/test/DebugInfo/gmlt.ll Tue Sep 30 16:28:32 2014<br>
> > @@ -1,5 +1,7 @@<br>
> >  ; REQUIRES: object-emission<br>
> >  ; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s<br>
> > +; RUN: %llc_dwarf -O0 -filetype=obj < %s -mtriple x86_64-apple-darwin | llvm-dwarfdump - \<br>
> > +; RUN:     | FileCheck --check-prefix=CHECK --check-prefix=DARWIN %s<br>
> ><br>
> >  ; Generated from the following source compiled with clang++ -gmlt:<br>
> >  ; void f1() {}<br>
> > @@ -17,6 +19,25 @@<br>
> >  ; CHECK:   DW_AT_ranges [DW_FORM_sec_offset] (0x00000000)<br>
> >  ; CHECK-NOT: {{DW_TAG|NULL}}<br>
> ><br>
> > +; Omitting the subprograms without inlined subroutines is not possible<br>
> > +; currently on Darwin as dsymutil will drop the whole CU if it has no subprograms<br>
> > +; (which happens with this optimization if there are no inlined subroutines).<br>
> > +<br>
> > +; DARWIN:  DW_TAG_subprogram<br>
> > +; DARWIN-NOT: DW_TAG<br>
> > +; DARWIN:    DW_AT_name {{.*}} "f1"<br>
> > +; DARWIN-NOT: {{DW_TAG|NULL}}<br>
> > +; DARWIN:  DW_TAG_subprogram<br>
> > +; DARWIN-NOT: DW_TAG<br>
> > +; DARWIN:    DW_AT_name {{.*}} "f2"<br>
> > +; DARWIN-NOT: {{DW_TAG|NULL}}<br>
> > +; DARWIN:  DW_TAG_subprogram<br>
> > +; DARWIN-NOT: DW_TAG<br>
> > +; Can't check the abstract_origin value across the DARWIN/CHECK checking and<br>
> > +; ordering, so don't bother - just trust me, it refers to f3 down there.<br>
> > +; DARWIN:    DW_AT_abstract_origin<br>
> > +; DARWIN-NOT: {{DW_TAG|NULL}}<br>
> > +<br>
> ><br>
> >  ; FIXME: Emitting separate abstract definitions is inefficient when we could<br>
> >  ; just attach the DW_AT_name to the inlined_subroutine directly. Except that<br>
> ><br>
> ><br>
> > _______________________________________________<br>
> > llvm-commits mailing list<br>
> > <a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
> > <a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</p>