[LLVMdev] [proposal] Extensible IR metadata

Chris Lattner clattner at apple.com
Fri Sep 11 17:22:51 PDT 2009

On Sep 11, 2009, at 3:23 PM, David Greene wrote:
> I have a few questions and comments about Chris' initial proposal as  
> well.
> - 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.

> - Defaulting alignment to 1 when metatadata is not present is going  
> to be a
>  huge performance hit on many architectures.  I hope we can find a  
> better
>  solution.  I'm not sure what it is yet because we have to maintain  
> safety.
>  I just fear a Pass inadvertantly dropping metadata and really  
> screwing
>  things up.

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.


More information about the llvm-dev mailing list