[LLVMdev] RFP: Metadata is being used poorly to paper over missing IR constructs

Chandler Carruth chandlerc at gmail.com
Fri Jan 9 13:45:07 PST 2015


On Fri, Jan 9, 2015 at 1:21 PM, Chris Lattner <clattner at apple.com> wrote:

> > #2
> > We need to make module flags a first class entity of the module, just
> like datalayout:
> >
> >   &flag = ....
> >
> > (syntax shamelessly stolen from Duncan's suggestion in IRC)
>
> I disagree.  The concerns about “stability” of metadata don’t apply to
> module-level metadata that doesn’t refer to the other IR in the module.  A
> nice thing about module-level metadata is that it eliminates the “need" to
> encode features like command line flags directly in the IR in a custom
> tailored way.  There should be no need to design bitcode and .ll syntax for
> new things like command line flags.  If we had module-level metadata back
> in day 1, targetdata would be using it...


Calling whatever it is that encodes things in the module "metadata" makes
that term less useful. I don't really care about the syntax or encoding,
but I do very much care that we separate the terminology and APIs used for
entities that have very fundamentally different behavior constraints.

Metadata is discardable without changing correctness. These other things
are not. We need two different ways to describe and manipulate them so that
we don't continually get confused as to which case we are dealing with. And
"module-level" isn't even a good predicate because some things at the
module level are meeting the same constraints as the rest of metadata --
namely, debug information.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150109/5805a423/attachment.html>


More information about the llvm-dev mailing list