[LLVMbugs] [Bug 17892] New: Introduce new MDString/MDNode hybrid to reduce heap size of debug & profile metadata

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Nov 11 23:20:39 PST 2013


http://llvm.org/bugs/show_bug.cgi?id=17892

            Bug ID: 17892
           Summary: Introduce new MDString/MDNode hybrid to reduce heap
                    size of debug & profile metadata
           Product: libraries
           Version: 1.0
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: unassignedbugs at nondot.org
          Reporter: clattner at apple.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This is related to PR17891, but independent and separable.  One nice thing
about our current debug information encoding in MDNodes is that each MDNode
starts with a dwarf tag+version number, encoded into an integer at the start of
the field (it would be even nicer if the asmwriter printed the value in hex,
but, anyway).  If we take PR17891 to its logical conclusion, we lose the
uniformity that the current encoding provides as we get a sprawl of ad-hoc
encoding approaches.

We could solve this by allowing MDString to optionally have children nodes (the
same way MDNode does today).  This would lead to an LLVM IR syntax something
along the lines of:

// This exists today, and the asmwriter would generally continue to print
operand-less MDStrings inline instead of numbering them.
!0 = metadata !"foo"

// This would be the new syntax (this is one of many possible syntaxes):
!1 = metadata !"bar"(metadata !42, i32* null)

If we did this, then we could get the consistency advantages of the current
metadata encoding, with the density advantages sketched out in PR17891.  The
general form of a debug info node would become a string that starts with the DW
tag, a version, and any string fields encoded as strings.  If there are any
nodes that want sharing, they would be encoded as operands.  To give one
concrete example, instead of this for a field:

; [ DW_TAG_member ] [y] [line 3, size 32, align 32, offset 32] [from int]
!14 = metadata !{i32 786445, metadata !1, metadata !10, metadata !"y", i32 3,
i64 32, i64 32, i64 32, i32 0, metadata !13}

We could use:

; [ DW_TAG_member ] [y] [line 3, size 32, align 32, offset 32] [from int]
!14 = metadata !"v12,14,y,3,0,32,32,32"(metadata !1, metadata !13)

This would keep readability and would be a *huge* reduction of heap size for
debug info.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131112/895abf9c/attachment.html>


More information about the llvm-bugs mailing list