[LLVMdev] [proposal] Extensible IR metadata

David Greene dag at cray.com
Fri Sep 11 17:54:31 PDT 2009


On Friday 11 September 2009 19:22, Chris Lattner wrote:

> > - I don't like the separation between "built-in" metadata and
> > "extended"
> >  metadata.  Why not make all metadata use the RegisterMDKind
> > interface and
> >  just have the LLVM libraries do it automatically for the "built-in"
> > stuff?
> >  Having a separate namespace of enums is going to get confusing.
> > Practically
> >  every day I curse the fact that "int" is different than "MyInt" in C
> > ++.  :-/
>
> "builtin" metadata would also be registered, the only magic would be
> that the encoding would be smaller in the IR.

Except the API is different.  Built-in types use a well-known enum
value not available to extended metadata.  I have no problem with a
smaller IR encoding.  It's the programming interface I'm concerned
about.  I'd rather it be the same for everything.

> I don't expect metadata to be commonly stripped.  This could be just
> as bad a perf problem for other things like TBAA or high level type
> information for a dynamic language.  I think it is important that the
> IR is possible to reason about even in uncommon cases though.

Sure.  Just something we need to be aware of.

                               -Dave



More information about the llvm-dev mailing list