[llvm] r348898 - Revert "debuginfo: Use symbol difference for CU length to simplify assembly reading/editing"

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 17 11:34:59 PST 2018


Alexey or Eric are the people who have the best chance to answer your
question.

In general, emitting DWARF in PTX is a rather hairy process due to the
limitations (and quirks) of PTX and your patch may have tripped on some of
them.


On Mon, Dec 17, 2018 at 11:20 AM David Blaikie <dblaikie at gmail.com> wrote:

>
>
> On Tue, Dec 11, 2018 at 1:29 PM Jordan Rupprecht via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>> Author: rupprecht
>> Date: Tue Dec 11 13:26:52 2018
>> New Revision: 348898
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=348898&view=rev
>> Log:
>>  Revert "debuginfo: Use symbol difference for CU length to simplify
>> assembly reading/editing"
>>
>> Temporarily reverts commit r348806 due to strange asm compilation issues
>> in certain modes (combination of asan+cuda+other things). Will provide
>> repro soon.
>>
>
> Jordan - did you happen to get any more info on this?
>
> Art - given cuda+debug info is something you've some context on. Any idea
> why the "if !nvptx" logic in this code wouldn't be sufficient & what would
> be sufficient to workaround this issue?
>
>
>>
>> Modified:
>>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp
>>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
>>     llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
>>     llvm/trunk/test/DebugInfo/X86/sections_as_references.ll
>>
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp?rev=348898&r1=348897&r2=348898&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfFile.cpp Tue Dec 11 13:26:52
>> 2018
>> @@ -46,8 +46,6 @@ void DwarfFile::emitUnit(DwarfUnit *TheU
>>    TheU->emitHeader(UseOffsets);
>>
>>    Asm->emitDwarfDIE(Die);
>> -
>> -  Asm->OutStreamer->EmitLabel(TheU->getEndLabel());
>>  }
>>
>>  // Compute the size and offset for each DIE.
>>
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp?rev=348898&r1=348897&r2=348898&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.cpp Tue Dec 11 13:26:52
>> 2018
>> @@ -38,7 +38,6 @@
>>  #include "llvm/Support/Casting.h"
>>  #include "llvm/Support/CommandLine.h"
>>  #include "llvm/Target/TargetLoweringObjectFile.h"
>> -#include "llvm/Target/TargetMachine.h"
>>  #include <cassert>
>>  #include <cstdint>
>>  #include <string>
>> @@ -1554,17 +1553,7 @@ DIE *DwarfUnit::getOrCreateStaticMemberD
>>  void DwarfUnit::emitCommonHeader(bool UseOffsets, dwarf::UnitType UT) {
>>    // Emit size of content not including length itself
>>    Asm->OutStreamer->AddComment("Length of Unit");
>> -  StringRef Prefix = isDwoUnit() ? "debug_info_dwo_" : "debug_info_";
>> -  MCSymbol *BeginLabel = Asm->createTempSymbol(Prefix + "start");
>> -  EndLabel = Asm->createTempSymbol(Prefix + "end");
>> -
>> -  // Use a label difference for the convenience of legible/easily
>> modified
>> -  // assembly - except on NVPTX where label differences aren't supported.
>> -  if (Asm->TM.getTargetTriple().isNVPTX())
>> -    Asm->emitInt32(getHeaderSize() + getUnitDie().getSize());
>> -  else
>> -    Asm->EmitLabelDifference(EndLabel, BeginLabel, 4);
>> -  Asm->OutStreamer->EmitLabel(BeginLabel);
>> +  Asm->emitInt32(getHeaderSize() + getUnitDie().getSize());
>>
>>    Asm->OutStreamer->AddComment("DWARF version number");
>>    unsigned Version = DD->getDwarfVersion();
>>
>> Modified: llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h?rev=348898&r1=348897&r2=348898&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h (original)
>> +++ llvm/trunk/lib/CodeGen/AsmPrinter/DwarfUnit.h Tue Dec 11 13:26:52 2018
>> @@ -48,7 +48,6 @@ protected:
>>
>>    /// Target of Dwarf emission.
>>    AsmPrinter *Asm;
>> -  MCSymbol *EndLabel;
>>
>>    // Holders for some common dwarf information.
>>    DwarfDebug *DD;
>> @@ -83,7 +82,6 @@ protected:
>>  public:
>>    // Accessors.
>>    AsmPrinter* getAsmPrinter() const { return Asm; }
>> -  MCSymbol *getEndLabel() const { return EndLabel; }
>>    uint16_t getLanguage() const { return CUNode->getSourceLanguage(); }
>>    const DICompileUnit *getCUNode() const { return CUNode; }
>>
>>
>> Modified: llvm/trunk/test/DebugInfo/X86/sections_as_references.ll
>> URL:
>> http://llvm.org/viewvc/llvm-project/llvm/trunk/test/DebugInfo/X86/sections_as_references.ll?rev=348898&r1=348897&r2=348898&view=diff
>>
>> ==============================================================================
>> --- llvm/trunk/test/DebugInfo/X86/sections_as_references.ll (original)
>> +++ llvm/trunk/test/DebugInfo/X86/sections_as_references.ll Tue Dec 11
>> 13:26:52 2018
>> @@ -9,19 +9,13 @@
>>  ; CHECK-NOT: .L
>>
>>  ; CHECK:      .section .debug_info
>> -; CHECK-NEXT: .long .Ldebug_info_end0-.Ldebug_info_start0 # Length of
>> Unit
>> -; CHECK-NEXT: .Ldebug_info_start0:
>> -; CHECK-NEXT: .short 2             # DWARF version number
>> +; CHECK-NOT:  .L
>> +; CHECK:      .short 2             # DWARF version number
>>  ; CHECK-NOT:  .L
>>  ; CHECK:      .long .debug_abbrev  # Offset Into Abbrev. Section
>>  ; CHECK-NOT:  .L
>>  ; CHECK:      .long .debug_line    # DW_AT_stmt_list
>>  ; CHECK-NOT:  .L
>> -; CHECK:      .Ldebug_info_end0:
>> -; CHECK-NOT:  .L
>> -; CHECK:      .long .Ldebug_info_end1-.Ldebug_info_start1 # Length of
>> Unit
>> -; CHECK-NEXT: .Ldebug_info_start1:
>> -; CHECK-NOT:  .L
>>  ; CHECK:      .long .debug_abbrev  # Offset Into Abbrev. Section
>>  ; CHECK-NOT:  .L
>>  ; CHECK:      .long .debug_line    # DW_AT_stmt_list
>> @@ -29,7 +23,6 @@
>>  ; CHECK:      .quad .debug_info+{{[0-9]+}} # DW_AT_type
>>  ; CHECK-NOT:  .L
>>  ; CHECK:      .byte 0              # End Of Children Mark
>> -; CHECK-NEXT: .Ldebug_info_end1:
>>  ; CHECK-NOT:  .L
>>
>>  source_filename = "test/DebugInfo/X86/sections_as_references.ll"
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
>

-- 
--Artem Belevich
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181217/478873d9/attachment.html>


More information about the llvm-commits mailing list