[LLVMbugs] [Bug 22778] New: Remove the inlinedAt: field from DI/MDLocalVariable

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Mar 3 16:51:31 PST 2015


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

            Bug ID: 22778
           Summary: Remove the inlinedAt: field from DI/MDLocalVariable
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
          Assignee: dexonsmith at apple.com
          Reporter: dexonsmith at apple.com
                CC: aprantl at apple.com, dblaikie at gmail.com,
                    echristo at gmail.com, friss at apple.com,
                    llvmbugs at cs.uiuc.edu
            Blocks: 21432
    Classification: Unclassified

We should remove the `inlinedAt:` field from local variables, now that the
specialized hierarchy is in place from bug 22464.

It's a horrible hack that `MDLocalVariable` has an `inlinedAt:` field.  It's
used to attach where the variable has been inlined to `!dbg.value` and
!dbg.declare` intrinsics, but that information is already attached via `!dbg`:

      call !dbg.value(..., metadata !1, ...), !dbg !2
    ; ...
    !1 = !MDLocalVariable(..., inlinedAt: !3)
    !2 = !MDLocation(..., inlinedAt: !3)
    !3 = !MDLocation(...)

Moreover, creating these inlined copies of variables is expensive.  I recently
ran a clang -g -flto bootstrap; during LTO, calls to `createInlinedVariable()`
accounted for ~3% of the total memory allocated (almost 10% of the memory used
for IR).

Why don't we already use the `!dbg` attachments?  My understanding is that we
didn't used to be able to count on them being present and accurate, but
dblaikie has done (most of?) the work to make them so.

Known things left to do:

1. Keep track of `!dbg` attachments to `!dbg.declare`s in the MMI side-table.
2. Add assertions (in the verifier and in the backend) that for all debug
intrinsics, the `inlinedAt:` pointers match between the variable reference and
the `!dbg` attachment.
3. Teach the backend to use the `!dbg` attachments exclusively.
4. Remove `inlinedAt:` (and related API) from `MDLocalVariable`.

-- 
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/20150304/54c06625/attachment.html>


More information about the llvm-bugs mailing list