[llvm-dev] RFC: metadata attachments for global variables

Peter Collingbourne via llvm-dev llvm-dev at lists.llvm.org
Fri May 6 13:54:20 PDT 2016


Thanks Adrian.

The ASan issue in that code review actually seems very similar to some of
the global variable manipulation that I'm doing as part of whole-program
vtable optimization and CFI (see e.g. DevirtModule::rebuildGlobal). I'll
have to think about whether there's maybe some solution to this problem
that could be used by ASan, vtable opt and CFI.

How can we end up with more than one !dbg per global? Because of global
merging?

Peter

On Fri, May 6, 2016 at 1:30 PM, Adrian Prantl <aprantl at apple.com> wrote:

> You have my full support! I actually started implementing this to fix the
> problem outlined in http://reviews.llvm.org/D18109, but then was
> side-tracked by some ThinLTO work. I’ve attached my early stage WIP patch
> to the D18109, in case you are interested in looking at it and/or picking
> up from there. There are some interesting challenges, such as the fact that
> we need to support more than one !dbg attachement per global and the need
> to replace constants in the global field with DIExpressions that I haven’t
> tackled yet.
>
> -- adrian
>
>
> > On May 6, 2016, at 1:17 PM, Peter Collingbourne via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
> >
> > Hi all,
> >
> > I'd like to add support for metadata attachments for global variables in
> the same way as we did for functions.
> >
> > Syntax would be pretty simple:
> > @foo = global i32 0, !foo !0, !bar !1
> > (the extra commas are required to disambiguate from a named metadata on
> the next line)
> >
> > Benefits:
> > 1) Lets us reverse the DIGlobalVariable -> GlobalVariable edge, which
> should hopefully clear the way for removing the llvm.dbg.cu named
> metadata node.
> >
> > 2) Allows for bitset metadata to be attached to globals rather than
> being represented as a named metadata node. This means that bitset metadata
> is naturally dropped when globals are dropped, and makes it easier to
> manipulate bitset metadata and build summaries of bitset definitions.
> >
> > Comments appreciated.
> >
> > Thanks,
> > --
> > --
> > Peter
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>


-- 
-- 
Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160506/e4968832/attachment.html>


More information about the llvm-dev mailing list